mirror of
https://github.com/penpot/penpot.git
synced 2025-07-23 08:07:16 +02:00
🐛 Fix color picker broken images
This commit is contained in:
parent
b7e1e54a92
commit
42cd9a59b9
2 changed files with 46 additions and 12 deletions
|
@ -8,6 +8,7 @@
|
|||
"HTML5 web api helpers."
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.logging :as log]
|
||||
[app.util.object :as obj]
|
||||
[beicon.core :as rx]
|
||||
|
@ -21,10 +22,15 @@
|
|||
(rx/create
|
||||
(fn [subs]
|
||||
(let [reader (js/FileReader.)]
|
||||
(obj/set! reader "onload" #(do (rx/push! subs (.-result reader))
|
||||
(obj/set! reader "onload" #(do (rx/push! subs (.-result ^js reader))
|
||||
(rx/end! subs)))
|
||||
(obj/set! reader "onerror" #(rx/error! subs %))
|
||||
(obj/set! reader "onabort" #(rx/error! subs (ex/error :type :internal
|
||||
:code :abort
|
||||
:hint "operation aborted")))
|
||||
(f reader)
|
||||
(constantly nil)))))
|
||||
(fn []
|
||||
(.abort ^js reader))))))
|
||||
|
||||
(defn read-file-as-text
|
||||
[file]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue