Browse Source

fix: show to render when switching from search to other tab

Tienson Qin 2 days ago
parent
commit
2a5f0ffb09
2 changed files with 6 additions and 4 deletions
  1. 3 3
      src/main/mobile/bottom_tabs.cljs
  2. 3 1
      src/main/mobile/core.cljs

+ 3 - 3
src/main/mobile/bottom_tabs.cljs

@@ -84,12 +84,12 @@
   (do
     (add-tab-selected-listener!
      (fn [tab]
-       (let [exit-quick-add? (= @*previous-tab "quick-add")
-             search? (= "search" tab)]
+       (let [exit-quick-add? (= "quick-add" @*previous-tab)
+             exit-search? (= "search" @*previous-tab)]
          (reset! mobile-state/*search-input "")
          (when-not (or (contains? #{"quick-add"} tab)
                        (= tab @*previous-tab))
-           (when-not (or exit-quick-add? search?)
+           (when-not (or exit-quick-add? exit-search?)
              (mobile-nav/reset-route!))
            (mobile-state/set-tab! tab))
 

+ 3 - 1
src/main/mobile/core.cljs

@@ -85,7 +85,9 @@
          (if pop?
            (route-handler/set-route-match! route)
            (reset! *route-timeout
-                   (js/setTimeout #(route-handler/set-route-match! route) 200)))))
+                   (js/setTimeout
+                    #(route-handler/set-route-match! route)
+                    200)))))
 
      ;; set to false to enable HistoryAPI
      {:use-fragment true})))