0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-15 17:21:17 -05:00

🐛 Fix paste image in prod mode

This commit is contained in:
Andrés Moya 2020-06-03 13:57:31 +02:00
parent a3490ea36d
commit bd2ee2fd11

View file

@ -75,12 +75,12 @@
[data]
(assert (string? data) "`data` should be string")
(let [cboard (unchecked-get js/navigator "clipboard")]
(.writeText cboard data)))
(.writeText ^js cboard data)))
(defn- read-from-clipboard
[]
(let [cboard (unchecked-get js/navigator "clipboard")]
(rx/from (.readText cboard))))
(rx/from (.readText ^js cboard))))
(defn- read-image-from-clipboard
[]
@ -91,7 +91,7 @@
(if img-type
(rx/from (.getType item img-type))
(rx/empty))))]
(->> (rx/from (.read cboard)) ;; Get a stream of item lists
(->> (rx/from (.read ^js cboard)) ;; Get a stream of item lists
(rx/mapcat identity) ;; Convert each item into an emission
(rx/switch-map read-item))))