diff --git a/resources/js/preload.js b/resources/js/preload.js index d6de517e7f9..c4c173e25f0 100644 --- a/resources/js/preload.js +++ b/resources/js/preload.js @@ -9,9 +9,11 @@ function getFilePathFromClipboard () { if (IS_WIN32) { const rawFilePath = clipboard.read('FileNameW') return rawFilePath.replace(new RegExp(String.fromCharCode(0), 'g'), '') + } else if (IS_MAC) { + return clipboard.read('public.file-url').replace('file://', '') + } else{ + return clipboard.readText() } - - return clipboard.read('public.file-url').replace('file://', '') } function isClipboardHasImage () { diff --git a/src/main/frontend/components/editor.cljs b/src/main/frontend/components/editor.cljs index ae562805557..1bbcb023eea 100644 --- a/src/main/frontend/components/editor.cljs +++ b/src/main/frontend/components/editor.cljs @@ -742,7 +742,6 @@ (let [pick-one-allowed-item (fn [items] (if (util/electron?) - (let [existed-file-path (js/window.apis.getFilePathFromClipboard) has-file-path? (not (string/blank? existed-file-path)) has-image? (js/window.apis.isClipboardHasImage)]