chore: code cleanup

This commit is contained in:
Tienson Qin
2025-11-26 13:47:41 +08:00
parent bcf3c9bc57
commit e3054f5197
7 changed files with 8 additions and 10 deletions

View File

@@ -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!

View File

@@ -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

View File

@@ -144,7 +144,7 @@
(page-handler/<delete!
(fn []
;; FIXME: empty screen, wrong route state
(mobile-state/redirect-to-tab! "home"))
(mobile-state/set-tab! "home"))
{:error-handler
(fn [{:keys [msg]}]
(notification/show! msg :warning))})))))}

View File

@@ -6,6 +6,7 @@
[frontend.ui :as ui]
[logseq.shui.popup.core :as shui-popup]
[logseq.shui.ui :as shui]
[mobile.bottom-tabs :as bottom-tabs]
[mobile.state :as mobile-state]
[rum.core :as rum]))
@@ -105,7 +106,7 @@
(= :download-rtc-graph (first args))
(do
(dismiss-native-sheet!)
(mobile-state/redirect-to-tab! "home"))
(mobile-state/set-tab! "home"))
:else
(if (and @*last-popup-modal? (not (= (first args) :editor.commands/commands)))

View File

@@ -68,7 +68,7 @@
:skip-refresh? true})))))
:graphs
(mobile-state/redirect-to-tab! "settings")
(mobile-state/set-tab! "settings")
:import
(shui/popup-show! nil (fn []

View File

@@ -39,9 +39,6 @@
(state/pub-event! [:mobile/start-audio-record])
(and (= hostname "mobile") (= pathname "/go/quick-add"))
(editor-handler/show-quick-add)
(and (= hostname "mobile")
(contains? #{"/go/favorites"} pathname))
(mobile-state/redirect-to-tab! "favorites")
(= hostname "graph")
(let [graph-name (some-> pathname
(string/replace "/" "")

View File

@@ -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]