From 459bd2e779a05cd987a3b690ecbfe73814f74295 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Tue, 18 Oct 2022 10:13:18 +0800 Subject: [PATCH] fix: can't paste number close #6997 --- src/main/frontend/handler/editor.cljs | 1 - src/main/frontend/handler/paste.cljs | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/frontend/handler/editor.cljs b/src/main/frontend/handler/editor.cljs index 9c3bef51d8..17816e9071 100644 --- a/src/main/frontend/handler/editor.cljs +++ b/src/main/frontend/handler/editor.cljs @@ -370,7 +370,6 @@ (profile "Save block: " (let [block' (wrap-parse-block block)] - (util/pprint block') (outliner-tx/transact! {:outliner-op :save-block} (outliner-core/save-block! block')) diff --git a/src/main/frontend/handler/paste.cljs b/src/main/frontend/handler/paste.cljs index bb3f20666a..0ee31ddecd 100644 --- a/src/main/frontend/handler/paste.cljs +++ b/src/main/frontend/handler/paste.cljs @@ -70,7 +70,10 @@ (let [copied-blocks (state/get-copied-blocks) input (state/get-input) text (string/replace text "\r\n" "\n") ;; Fix for Windows platform - whiteboard-shape? (= "logseq/whiteboard-shapes" (gobj/get (try-parse-as-json text) "type")) + whiteboard-data (try-parse-as-json text) + whiteboard-shape? (and whiteboard-data + (object? whiteboard-data) + (= "logseq/whiteboard-shapes" (.-type whiteboard-data))) text (if whiteboard-shape? (block-ref/->block-ref (gobj/getValueByKeys (try-parse-as-json text) "shapes" 0 "id")) text)