diff --git a/src/main/frontend/handler/events/ui.cljs b/src/main/frontend/handler/events/ui.cljs index 73d51c14e5..7205b22f2c 100644 --- a/src/main/frontend/handler/events/ui.cljs +++ b/src/main/frontend/handler/events/ui.cljs @@ -91,7 +91,7 @@ (defmethod events/handle :redirect-to-home [_] (page-handler/create-today-journal!) (when (util/capacitor?) - (mobile-state/redirect-to-tab! "home"))) + (mobile-state/set-tab! "home"))) (defmethod events/handle :page/show-delete-dialog [[_ selected-rows ok-handler]] (shui/dialog-open! diff --git a/src/main/mobile/bottom_tabs.cljs b/src/main/mobile/bottom_tabs.cljs index 3f2e94257f..368cc4998f 100644 --- a/src/main/mobile/bottom_tabs.cljs +++ b/src/main/mobile/bottom_tabs.cljs @@ -77,6 +77,9 @@ ;; (state/pub-event! [:mobile/start-audio-record]) ;; (editor-handler/show-quick-add)) nil))) + (add-watch mobile-state/*tab ::select-tab + (fn [_ _ old new] + (when new (select! new)))) (add-search-listener! (fn [q] ;; wire up search handler diff --git a/src/main/mobile/components/header.cljs b/src/main/mobile/components/header.cljs index 185ec29fe5..ec86738f29 100644 --- a/src/main/mobile/components/header.cljs +++ b/src/main/mobile/components/header.cljs @@ -144,7 +144,7 @@ (page-handler/ pathname (string/replace "/" "") diff --git a/src/main/mobile/state.cljs b/src/main/mobile/state.cljs index c53f959b57..38c7bcb93a 100644 --- a/src/main/mobile/state.cljs +++ b/src/main/mobile/state.cljs @@ -24,9 +24,6 @@ [] (= :ls-quick-add (get-in @*popup-data [:opts :id]))) -(defn redirect-to-tab! [name] - (set-tab! (str name))) - (defonce *log (atom [])) (defn log-append! [record]