fix: multiple assets upload support

fix https://github.com/logseq/db-test/issues/516
This commit is contained in:
Tienson Qin
2025-10-23 03:13:21 +08:00
parent 031f2bc57e
commit ac14dfd172
2 changed files with 81 additions and 77 deletions

View File

@@ -257,13 +257,9 @@
(when id
(let [clipboard-data (gobj/get e "clipboardData")
files (.-files clipboard-data)]
(loop [files files]
(when-let [file (first files)]
(when-let [block (state/get-edit-block)]
(editor-handler/upload-asset! id #js[file]
(get block :block/format :markdown)
editor-handler/*asset-uploading? true))
(recur (rest files))))
(editor-handler/upload-asset! id files
(get (state/get-edit-block) :block/format :markdown)
editor-handler/*asset-uploading? true)
(util/stop e))))
(defn editor-on-paste!