mirror of
https://github.com/logseq/logseq.git
synced 2026-05-19 18:32:41 +00:00
fix: route mobile search results through home stack
This commit is contained in:
@@ -426,9 +426,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UINavigationControllerDel
|
||||
return
|
||||
}
|
||||
|
||||
// ⚡️ Fast-path: cancel search → home root.
|
||||
// Fast-path: cancel search -> home root.
|
||||
if previousStackId == "search",
|
||||
stackId == "home"{
|
||||
stackId == "home",
|
||||
path == self.rootPath(for: "home") {
|
||||
|
||||
self.setPaths(["/__stack__/search"], for: "search")
|
||||
self.activeStackId = "home"
|
||||
@@ -462,6 +463,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UINavigationControllerDel
|
||||
} else if newPaths.isEmpty {
|
||||
// First time visiting this stack
|
||||
newPaths = [path]
|
||||
} else if navigationType == "push",
|
||||
let last = newPaths.last,
|
||||
last != path {
|
||||
newPaths.append(path)
|
||||
} else if let last = newPaths.last, last != path {
|
||||
// Same history, but different top path → align the top.
|
||||
newPaths[newPaths.count - 1] = path
|
||||
|
||||
@@ -82,6 +82,11 @@
|
||||
(fn [data]
|
||||
(when-let [id (.-id data)]
|
||||
(when-not (string/blank? id)
|
||||
(when (= "search" @mobile-state/*tab)
|
||||
(reset! mobile-state/*search-input "")
|
||||
(mobile-nav/reset-stack-history! "search")
|
||||
(reset! mobile-state/*tab "home")
|
||||
(mobile-nav/set-current-stack! "home"))
|
||||
(route-handler/redirect-to-page! id {:push (mobile-util/native-platform?)})))))))
|
||||
|
||||
(defn add-keyboard-hack-listener!
|
||||
|
||||
Reference in New Issue
Block a user