mirror of
https://github.com/penpot/penpot.git
synced 2026-08-05 04:18:41 +00:00
🐛 Fix paste image in prod mode
This commit is contained in:
parent
a3490ea36d
commit
bd2ee2fd11
@ -75,12 +75,12 @@
|
|||||||
[data]
|
[data]
|
||||||
(assert (string? data) "`data` should be string")
|
(assert (string? data) "`data` should be string")
|
||||||
(let [cboard (unchecked-get js/navigator "clipboard")]
|
(let [cboard (unchecked-get js/navigator "clipboard")]
|
||||||
(.writeText cboard data)))
|
(.writeText ^js cboard data)))
|
||||||
|
|
||||||
(defn- read-from-clipboard
|
(defn- read-from-clipboard
|
||||||
[]
|
[]
|
||||||
(let [cboard (unchecked-get js/navigator "clipboard")]
|
(let [cboard (unchecked-get js/navigator "clipboard")]
|
||||||
(rx/from (.readText cboard))))
|
(rx/from (.readText ^js cboard))))
|
||||||
|
|
||||||
(defn- read-image-from-clipboard
|
(defn- read-image-from-clipboard
|
||||||
[]
|
[]
|
||||||
@ -91,7 +91,7 @@
|
|||||||
(if img-type
|
(if img-type
|
||||||
(rx/from (.getType item img-type))
|
(rx/from (.getType item img-type))
|
||||||
(rx/empty))))]
|
(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/mapcat identity) ;; Convert each item into an emission
|
||||||
(rx/switch-map read-item))))
|
(rx/switch-map read-item))))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user