0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-14 08:41:48 -05:00

🐛 Fix bug when uploading the same image twice

This commit is contained in:
Andrés Moya 2020-06-08 12:43:44 +02:00 committed by Andrey Antukh
parent 3e5f9a01ad
commit b915ba51aa
2 changed files with 10 additions and 7 deletions

View file

@ -177,7 +177,7 @@
(throw (ex-info (tr "errors.image-format-unsupported") {}))) (throw (ex-info (tr "errors.image-format-unsupported") {})))
file) file)
on-success #(do (println "hola") (st/emit! dm/hide)) on-success #(do (st/emit! dm/hide))
on-error #(do (st/emit! dm/hide) on-error #(do (st/emit! dm/hide)
(if (.-message %) (if (.-message %)

View file

@ -18,12 +18,15 @@
[{:keys [accept multi label-text label-class input-id input-ref on-selected] :as props}] [{:keys [accept multi label-text label-class input-id input-ref on-selected] :as props}]
(let [opt-pick-one #(if multi % (first %)) (let [opt-pick-one #(if multi % (first %))
on-files-selected (fn [event] (st/emit! on-files-selected (fn [event]
(some-> (dom/get-target event) (let [target (dom/get-target event)]
(dom/get-files) (st/emit!
(array-seq) (some-> target
(opt-pick-one) (dom/get-files)
(on-selected))))] (array-seq)
(opt-pick-one)
(on-selected)))
(dom/clean-value! target)))]
[:* [:*
(when label-text (when label-text
[:label {:for input-id :class-name label-class} label-text]) [:label {:for input-id :class-name label-class} label-text])