fix: focusing shape id even in the same whiteboard & display block ref correctly

This commit is contained in:
Peng Xiao
2022-11-23 11:53:52 +08:00
parent 5480e1bd0d
commit 68ea04af52
14 changed files with 403 additions and 368 deletions

View File

@@ -3,12 +3,12 @@
[frontend.config :as config]
[frontend.date :as date]
[frontend.db :as db]
[frontend.handler.ui :as ui-handler]
[frontend.handler.recent :as recent-handler]
[frontend.handler.search :as search-handler]
[frontend.handler.ui :as ui-handler]
[frontend.state :as state]
[logseq.graph-parser.text :as text]
[frontend.util :as util]
[logseq.graph-parser.text :as text]
[reitit.frontend.easy :as rfe]))
(defn redirect!
@@ -65,9 +65,11 @@
(redirect-to-whiteboard! name nil))
([name {:keys [block-id]}]
(recent-handler/add-page-to-recent! (state/get-current-repo) name false)
(redirect! {:to :whiteboard
:path-params {:name (str name)}
:query-params (merge {:block-id block-id})})))
(if (= name (state/get-current-whiteboard))
(state/focus-whiteboard-shape block-id)
(redirect! {:to :whiteboard
:path-params {:name (str name)}
:query-params (merge {:block-id block-id})}))))
(defn get-title
[name path-params]