1
0
Эх сурвалжийг харах

improve(api): the last active block also represent for current block

charlie 3 жил өмнө
parent
commit
a14b397899

+ 3 - 1
src/main/logseq/api.cljs

@@ -545,7 +545,9 @@
 (def ^:export get_current_block
   (fn [^js opts]
     (let [block (state/get-edit-block)
-          block (or block (some-> (first (state/get-selection-blocks))
+          block (or block
+                    (some-> (or (first (state/get-selection-blocks))
+                                (gdom/getElement (state/get-editing-block-dom-id)))
                             (.getAttribute "blockid")
                             (db-model/get-block-by-uuid)))]
       (get_block (:db/id block) opts))))