fix(electron): quick captured text is cleared when editing current

pull/7544/head^2 0.8.12
Andelf 2022-12-02 13:48:19 +08:00
parent 73039901d0
commit a1b731a77a
1 changed files with 8 additions and 6 deletions

View File

@ -197,12 +197,14 @@
(editor-handler/insert (str "\n" content)))
(do
(editor-handler/escape-editing)
(when (not= page (state/get-current-page))
(page-handler/create! page {:redirect? redirect-page?}))
(editor-handler/escape-editing)
(editor-handler/api-insert-new-block! content {:page page
;; Or else this will clear the newly inserted content
(js/setTimeout #(editor-handler/api-insert-new-block! content {:page page
:edit-block? true
:replace-empty-target? true}))))))
:replace-empty-target? true})
100))))))
(js/window.apis.on "openNewWindowOfGraph"
;; Handle open new window in renderer, until the destination graph doesn't rely on setting local storage