Просмотр исходного кода

remove duplicate logic about identify whether it's cut paste

Mega Yu 2 лет назад
Родитель
Сommit
70c9bb10b8

+ 1 - 3
src/main/frontend/handler/editor.cljs

@@ -2024,8 +2024,7 @@
                   target-block
                   sibling?
                   keep-uuid?
-                  cut-paste?
-                  revert-cut-tx]
+                  revert-cut-txs]
            :or {exclude-properties []}}]
   (let [editing-block (when-let [editing-block (state/get-edit-block)]
                         (some-> (db/pull [:block/uuid (:block/uuid editing-block)])
@@ -2074,7 +2073,6 @@
                              (paste-block-cleanup block page exclude-properties format content-update-fn keep-uuid?))
                         blocks)
               result (outliner-core/insert-blocks! blocks' target-block' {:sibling? sibling?
-                                                                          :cut-paste? cut-paste?
                                                                           :outliner-op :paste
                                                                           :replace-empty-target? replace-empty-target?
                                                                           :keep-uuid? keep-uuid?})]

+ 0 - 2
src/main/frontend/handler/paste.cljs

@@ -184,10 +184,8 @@
      (if (seq copied-blocks)
        ;; Handle internal paste
        (let [revert-cut-txs (get-revert-cut-txs copied-blocks)
-             cut-paste? (boolean (seq revert-cut-txs))
              keep-uuid? (= (state/get-block-op-type) :cut)]
          (editor-handler/paste-blocks copied-blocks {:revert-cut-txs revert-cut-txs
-                                                     :cut-paste? cut-paste?
                                                      :keep-uuid? keep-uuid?}))
        (paste-copied-text input text html)))
    (p/catch (fn [error]

+ 1 - 2
src/main/frontend/modules/outliner/core.cljs

@@ -528,11 +528,10 @@
                     For example, if `blocks` are from internal copy, the uuids
                     need to be changed, but there's no need for internal cut or drag & drop.
       `outliner-op`: what's the current outliner operation.
-      `cut-paste?`: whether it's pasted from cut blocks
       `replace-empty-target?`: If the `target-block` is an empty block, whether
                                to replace it, it defaults to be `false`.
     ``"
-  [blocks target-block {:keys [sibling? keep-uuid? outliner-op replace-empty-target? cut-paste?] :as opts}]
+  [blocks target-block {:keys [sibling? keep-uuid? outliner-op replace-empty-target?] :as opts}]
   {:pre [(seq blocks)
          (s/valid? ::block-map-or-entity target-block)]}
   (let [target-block' (get-target-block target-block)