mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
fix: can't edit blocks on whiteboards
This commit is contained in:
@@ -2614,11 +2614,15 @@
|
||||
(when-let [refs-cp (state/get-component :block/linked-references)]
|
||||
(refs-cp uuid)))]))]))
|
||||
|
||||
(rum/defc single-block-cp
|
||||
[block-uuid]
|
||||
(rum/defcs single-block-cp <
|
||||
{:init (fn [state]
|
||||
(let [container-id (swap! (:ui/container-id @state/state) inc)]
|
||||
(assoc state ::container-id container-id)))}
|
||||
[state block-uuid]
|
||||
(let [uuid (if (string? block-uuid) (uuid block-uuid) block-uuid)
|
||||
block (db/entity [:block/uuid uuid])
|
||||
config {:id (str uuid)
|
||||
:container-id (::container-id state)
|
||||
:db/id (:db/id block)
|
||||
:block/uuid uuid
|
||||
:block? true
|
||||
|
||||
@@ -623,7 +623,7 @@
|
||||
(when-let [block-uuid (and block-uuid (sdk-utils/uuid-or-throw-error block-uuid))]
|
||||
(when-let [block (db-model/query-block-by-uuid block-uuid)]
|
||||
(let [{:keys [pos] :or {pos :max}} (bean/->clj opts)]
|
||||
(editor-handler/edit-block! block pos))))))
|
||||
(editor-handler/edit-block! block pos {:container-id :unknown-container}))))))
|
||||
|
||||
;; TODO: perf improvement, some operations such as delete-block doesn't need to load the full page
|
||||
;; instead, the db worker should provide those calls
|
||||
|
||||
Reference in New Issue
Block a user