Selaa lähdekoodia

fix: paste files when presented

Tienson Qin 5 päivää sitten
vanhempi
sitoutus
11600c8dc3
1 muutettua tiedostoa jossa 1 lisäystä ja 12 poistoa
  1. 1 12
      src/main/frontend/handler/paste.cljs

+ 1 - 12
src/main/frontend/handler/paste.cljs

@@ -280,19 +280,8 @@
           html (.getData clipboard-data "text/html")
           html (.getData clipboard-data "text/html")
           text (.getData clipboard-data "text")
           text (.getData clipboard-data "text")
           has-files? (seq (.-files clipboard-data))]
           has-files? (seq (.-files clipboard-data))]
-      (cond
-        (and (string/blank? text) (string/blank? html))
-        ;; When both text and html are blank, paste file if exists.
-        ;; NOTE: util/stop is not called here if no file is provided,
-        ;; so the default paste behavior of the native platform will be used.
-        (when has-files?
-          (paste-file-if-exists id e))
-
-        ;; both file attachment and text/html exist
-        (and has-files? (state/preferred-pasting-file?))
+      (if has-files?
         (paste-file-if-exists id e)
         (paste-file-if-exists id e)
-
-        :else
         (paste-text-or-blocks-aux (state/get-input) e text html)))))
         (paste-text-or-blocks-aux (state/get-input) e text html)))))
 
 
 (defn editor-on-paste-raw!
 (defn editor-on-paste-raw!