mirror of
https://github.com/logseq/logseq.git
synced 2026-02-01 22:47:36 +00:00
fix: image paste
This commit is contained in:
@@ -115,7 +115,7 @@ contextBridge.exposeInMainWorld('apis', {
|
||||
|
||||
await fs.promises.mkdir(assetsRoot, { recursive: true })
|
||||
|
||||
from = decodeURIComponent(from || getFilePathFromClipboard())
|
||||
from = from && decodeURIComponent(from || getFilePathFromClipboard())
|
||||
|
||||
if (from) {
|
||||
// console.debug('copy file: ', from, dest)
|
||||
|
||||
@@ -1505,7 +1505,8 @@
|
||||
filename (str path "/" filename)]
|
||||
;(js/console.debug "Write asset #" dir filename file)
|
||||
(if (util/electron?)
|
||||
(let [from (.-path file)]
|
||||
(let [from (.-path file)
|
||||
from (if (string/blank? from) nil from)]
|
||||
(p/then (js/window.apis.copyFileToAssets dir filename from)
|
||||
#(p/resolved [filename (if (string? %) (js/File. #js[] %) file) (.join util/node-path dir filename)])))
|
||||
(p/then (fs/write-file! repo dir filename (.stream file) nil)
|
||||
|
||||
Reference in New Issue
Block a user