瀏覽代碼

fix: tabs not working for < ios 26

Tienson Qin 3 周之前
父節點
當前提交
fdd6a9ecf8
共有 1 個文件被更改,包括 24 次插入14 次删除
  1. 24 14
      ios/App/App/LiquidTabsRootView.swift

+ 24 - 14
ios/App/App/LiquidTabsRootView.swift

@@ -217,6 +217,8 @@ struct LiquidTabsRootView: View {
                         .foregroundColor: dimmed
                         .foregroundColor: dimmed
                     ]
                     ]
 
 
+                    appearance.stackedLayoutAppearance.normal.iconColor = UIColor.label.withAlphaComponent(0.9)
+
                     // Apply the appearance
                     // Apply the appearance
                     let tabBar = UITabBar.appearance()
                     let tabBar = UITabBar.appearance()
                     tabBar.tintColor = .label
                     tabBar.tintColor = .label
@@ -276,9 +278,16 @@ struct LiquidTabsRootView: View {
             ZStack {
             ZStack {
                 Color.logseqBackground.ignoresSafeArea()
                 Color.logseqBackground.ignoresSafeArea()
 
 
-                TabView(selection: Binding(
-                    get: { store.selectedId ?? firstTab?.id },
-                    set: { newValue in
+                if store.tabs.isEmpty {
+                    // 🔑 Bootstrapping path: attach the shared webview
+                    // so JS can run and configure tabs.
+                    NativeNavHost(navController: navController)
+                      .ignoresSafeArea()
+                      .background(Color.logseqBackground)
+                } else {
+                    TabView(selection: Binding(
+                              get: { store.selectedId ?? firstTab?.id },
+                              set: { newValue in
                         guard let id = newValue else { return }
                         guard let id = newValue else { return }
 
 
                         // Fallback Re-Tap Logic
                         // Fallback Re-Tap Logic
@@ -290,19 +299,20 @@ struct LiquidTabsRootView: View {
                             LiquidTabsPlugin.shared?.notifyTabSelected(id: id)
                             LiquidTabsPlugin.shared?.notifyTabSelected(id: id)
                         }
                         }
                     }
                     }
-                )) {
-                    ForEach(store.tabs) { tab in
-                        NativeNavHost(navController: navController)
-                            .ignoresSafeArea()
-                            .background(Color.logseqBackground)
-                            .tabItem {
-                                Label(tab.title, systemImage: tab.systemImage)
-                            }
-                            .tag(tab.id as String?)
+                            )) {
+                        ForEach(store.tabs) { tab in
+                            NativeNavHost(navController: navController)
+                              .ignoresSafeArea()
+                              .background(Color.logseqBackground)
+                              .tabItem {
+                                  Label(tab.title, systemImage: tab.systemImage)
+                              }
+                              .tag(tab.id as String?)
+                        }
                     }
                     }
+                      .background(Color.logseqBackground)
+                      .toolbarBackground(Color.logseqBackground, for: .tabBar)
                 }
                 }
-                .background(Color.logseqBackground)
-                .toolbarBackground(Color.logseqBackground, for: .tabBar)
             }
             }
         }
         }
     }
     }