fix: routes for all graphs and import note

This commit is contained in:
Tienson Qin
2025-11-27 09:45:08 +08:00
parent 05ba914a42
commit cd4af15633
4 changed files with 14 additions and 15 deletions

View File

@@ -336,7 +336,10 @@
(when-not config/publishing?
(shui/button {:size :sm :variant :ghost
:on-click #(route-handler/redirect-to-all-graphs)}
:on-click (fn []
(if (util/mobile?)
(state/pub-event! [:mobile/set-tab "settings"])
(route-handler/redirect-to-all-graphs)))}
(shui/tabler-icon "layout-2") [:span (t :all-graphs)]))])
(rum/defcs repos-dropdown-content < rum/reactive

View File

@@ -3,7 +3,6 @@
(:require ["react-dom/client" :as rdc]
[clojure.string :as string]
[frontend.background-tasks]
[frontend.components.imports :as imports]
[frontend.db.async :as db-async]
[frontend.handler :as fhandler]
[frontend.handler.db-based.rtc-background-tasks]
@@ -11,7 +10,6 @@
[frontend.state :as state]
[frontend.util :as util]
[lambdaisland.glogi :as log]
[logseq.shui.ui :as shui]
[mobile.components.app :as app]
[mobile.components.selection-toolbar :as selection-toolbar]
[mobile.events]
@@ -66,14 +64,6 @@
{:children? false
:skip-refresh? true})))))
:graphs
(mobile-state/set-tab! "settings")
:import
(shui/popup-show! nil (fn []
(imports/importer {}))
{:id :import})
nil)))
;; set to false to enable HistoryAPI

View File

@@ -6,6 +6,7 @@
[logseq.shui.ui :as shui]
[mobile.components.recorder :as recorder]
[mobile.init :as init]
[mobile.state :as mobile-state]
[reitit.frontend.easy :as rfe]))
(defmethod events/handle :mobile/clear-edit [_]
@@ -24,3 +25,7 @@
(defmethod events/handle :mobile/redirect-to [[_ {:keys [k params query]}]]
(rfe/push-state k params query))
(defmethod events/handle :mobile/set-tab [[_ tab]]
(when tab
(mobile-state/set-tab! tab)))

View File

@@ -1,6 +1,7 @@
(ns mobile.routes
"Routes used in mobile app"
(:require [frontend.components.page :as page]))
(:require [frontend.components.imports :as imports]
[frontend.components.page :as page]))
(def routes
[["/"
@@ -10,7 +11,7 @@
:view (fn [route-match]
[:div.mt-6
(page/page-cp (assoc route-match :mobile-page? true))])}]
["/graphs"
{:name :graphs}]
["/import"
{:name :import}]])
{:name :import
:view (fn []
(imports/importer {}))}]])