mirror of
https://github.com/penpot/penpot.git
synced 2025-03-13 16:21:57 -05:00
🐛 Fix bug when uploading the same image twice
This commit is contained in:
parent
3e5f9a01ad
commit
b915ba51aa
2 changed files with 10 additions and 7 deletions
|
@ -177,7 +177,7 @@
|
|||
(throw (ex-info (tr "errors.image-format-unsupported") {})))
|
||||
file)
|
||||
|
||||
on-success #(do (println "hola") (st/emit! dm/hide))
|
||||
on-success #(do (st/emit! dm/hide))
|
||||
|
||||
on-error #(do (st/emit! dm/hide)
|
||||
(if (.-message %)
|
||||
|
|
|
@ -18,12 +18,15 @@
|
|||
[{:keys [accept multi label-text label-class input-id input-ref on-selected] :as props}]
|
||||
(let [opt-pick-one #(if multi % (first %))
|
||||
|
||||
on-files-selected (fn [event] (st/emit!
|
||||
(some-> (dom/get-target event)
|
||||
(dom/get-files)
|
||||
(array-seq)
|
||||
(opt-pick-one)
|
||||
(on-selected))))]
|
||||
on-files-selected (fn [event]
|
||||
(let [target (dom/get-target event)]
|
||||
(st/emit!
|
||||
(some-> target
|
||||
(dom/get-files)
|
||||
(array-seq)
|
||||
(opt-pick-one)
|
||||
(on-selected)))
|
||||
(dom/clean-value! target)))]
|
||||
[:*
|
||||
(when label-text
|
||||
[:label {:for input-id :class-name label-class} label-text])
|
||||
|
|
Loading…
Add table
Reference in a new issue