瀏覽代碼

fix(mobile): re-tap capture results in app blank

Tienson Qin 5 天之前
父節點
當前提交
1b8c5ac3ab
共有 1 個文件被更改,包括 10 次插入5 次删除
  1. 10 5
      ios/App/App/LiquidTabsRootView.swift

+ 10 - 5
ios/App/App/LiquidTabsRootView.swift

@@ -137,11 +137,13 @@ private struct LiquidTabs26View: View {
 
     private func handleRetap(on selection: LiquidTabsTabSelection) {
         print("User re-tapped tab: \(selection)")
-        navController.popToRootViewController(animated: true)
+        guard let id = store.tabId(for: selection) else { return }
 
-        if let id = store.tabId(for: selection) {
-            LiquidTabsPlugin.shared?.notifyTabSelected(id: id)
+        if id != "capture" {
+            navController.popToRootViewController(animated: true)
         }
+
+        LiquidTabsPlugin.shared?.notifyTabSelected(id: id)
     }
 
     private func initialSelection() -> LiquidTabsTabSelection {
@@ -346,10 +348,13 @@ private struct LiquidTabs16View: View {
                         },
                         set: { newValue in
                             guard let id = newValue else { return }
+                            let isCaptureTab = store.tab(for: id)?.id == "capture"
 
-                            // Re-tap: pop to root
+                            // Re-tap: pop to root for normal tabs
                             if id == store.selectedId {
-                                navController.popToRootViewController(animated: true)
+                                if !isCaptureTab {
+                                    navController.popToRootViewController(animated: true)
+                                }
                                 LiquidTabsPlugin.shared?.notifyTabSelected(id: id)
                             } else {
                                 store.selectedId = id