mirror of
https://github.com/penpot/penpot.git
synced 2025-07-26 04:17:12 +02:00
🐛 Fix paste properties on readonly state (#5736)
This commit is contained in:
parent
c3df84d812
commit
0483d1fd93
1 changed files with 14 additions and 13 deletions
|
@ -1650,21 +1650,22 @@
|
||||||
[]
|
[]
|
||||||
(ptk/reify ::paste-selected-props
|
(ptk/reify ::paste-selected-props
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ _ _]
|
(watch [_ state _]
|
||||||
(letfn [(decode-entry [entry]
|
(when-not (-> state :workspace-global :read-only?)
|
||||||
(-> entry t/decode-str paste-transit-props))
|
(letfn [(decode-entry [entry]
|
||||||
|
(-> entry t/decode-str paste-transit-props))
|
||||||
|
|
||||||
(on-error [cause]
|
(on-error [cause]
|
||||||
(let [data (ex-data cause)]
|
(let [data (ex-data cause)]
|
||||||
(if (:not-implemented data)
|
(if (:not-implemented data)
|
||||||
(rx/of (ntf/warn (tr "errors.clipboard-not-implemented")))
|
(rx/of (ntf/warn (tr "errors.clipboard-not-implemented")))
|
||||||
(js/console.error "Clipboard error:" cause))
|
(js/console.error "Clipboard error:" cause))
|
||||||
(rx/empty)))]
|
(rx/empty)))]
|
||||||
|
|
||||||
(->> (wapi/read-from-clipboard)
|
(->> (wapi/read-from-clipboard)
|
||||||
(rx/map decode-entry)
|
(rx/map decode-entry)
|
||||||
(rx/take 1)
|
(rx/take 1)
|
||||||
(rx/catch on-error))))))
|
(rx/catch on-error)))))))
|
||||||
|
|
||||||
(defn selected-frame? [state]
|
(defn selected-frame? [state]
|
||||||
(let [selected (dsh/lookup-selected state)
|
(let [selected (dsh/lookup-selected state)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue