diff --git a/src/main/frontend/handler/editor.cljs b/src/main/frontend/handler/editor.cljs index b21fc6400..9255336fa 100644 --- a/src/main/frontend/handler/editor.cljs +++ b/src/main/frontend/handler/editor.cljs @@ -2017,6 +2017,7 @@ keep-uuid? revert-cut-txs] :or {exclude-properties []}}] + (state/set-editor-op! :paste-blocks) (let [editing-block (when-let [editing-block (state/get-edit-block)] (some-> (db/pull [:block/uuid (:block/uuid editing-block)]) (assoc :block/content (state/get-edit-content)))) @@ -2068,7 +2069,8 @@ :replace-empty-target? replace-empty-target? :keep-uuid? keep-uuid?})] (state/set-block-op-type! nil) - (edit-last-block-after-inserted! result)))))) + (edit-last-block-after-inserted! result))))) + (state/set-editor-op! nil)) (defn- block-tree->blocks "keep-uuid? - maintain the existing :uuid in tree vec" diff --git a/src/main/frontend/handler/editor/lifecycle.cljs b/src/main/frontend/handler/editor/lifecycle.cljs index 90e5c68a1..230e836c2 100644 --- a/src/main/frontend/handler/editor/lifecycle.cljs +++ b/src/main/frontend/handler/editor/lifecycle.cljs @@ -39,7 +39,7 @@ (when (and (not (contains? #{:insert :indent-outdent :auto-save :undo :redo :delete} (state/get-editor-op))) ;; Don't trigger auto-save if the latest op is undo or redo - (not (contains? #{:undo :redo} (state/get-editor-latest-op)))) + (not (contains? #{:undo :redo :paste-blocks} (state/get-editor-latest-op)))) (editor-handler/save-block! (get-state) value))) state)