mirror of
https://github.com/penpot/penpot.git
synced 2025-07-30 02:17:25 +02:00
🐛 Fix problem with thumbnails when duplicating artboards
This commit is contained in:
parent
196e193281
commit
7a796bc83f
1 changed files with 3 additions and 15 deletions
|
@ -22,7 +22,6 @@
|
||||||
[app.main.data.workspace.changes :as dch]
|
[app.main.data.workspace.changes :as dch]
|
||||||
[app.main.data.workspace.collapse :as dwc]
|
[app.main.data.workspace.collapse :as dwc]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[app.main.data.workspace.thumbnails :as dwt]
|
|
||||||
[app.main.data.workspace.undo :as dwu]
|
[app.main.data.workspace.undo :as dwu]
|
||||||
[app.main.data.workspace.zoom :as dwz]
|
[app.main.data.workspace.zoom :as dwz]
|
||||||
[app.main.refs :as refs]
|
[app.main.refs :as refs]
|
||||||
|
@ -549,13 +548,6 @@
|
||||||
(map #(get-in % [:obj :id]))
|
(map #(get-in % [:obj :id]))
|
||||||
(into (d/ordered-set)))
|
(into (d/ordered-set)))
|
||||||
|
|
||||||
dup-frames (->> changes
|
|
||||||
:redo-changes
|
|
||||||
(filter #(= (:type %) :add-obj))
|
|
||||||
(filter #(selected (:old-id %)))
|
|
||||||
(filter #(= :frame (get-in % [:obj :type])))
|
|
||||||
(map #(vector (:old-id %) (get-in % [:obj :id]))))
|
|
||||||
|
|
||||||
id-duplicated (first new-selected)
|
id-duplicated (first new-selected)
|
||||||
|
|
||||||
frames (into #{}
|
frames (into #{}
|
||||||
|
@ -563,18 +555,14 @@
|
||||||
selected)
|
selected)
|
||||||
undo-id (js/Symbol)]
|
undo-id (js/Symbol)]
|
||||||
|
|
||||||
(rx/concat
|
;; Warning: This order is important for the focus mode.
|
||||||
(->> (rx/from dup-frames)
|
(rx/of
|
||||||
(rx/map (fn [[old-id new-id]] (dwt/duplicate-thumbnail old-id new-id))))
|
|
||||||
|
|
||||||
;; Warning: This order is important for the focus mode.
|
|
||||||
(rx/of
|
|
||||||
(dwu/start-undo-transaction undo-id)
|
(dwu/start-undo-transaction undo-id)
|
||||||
(dch/commit-changes changes)
|
(dch/commit-changes changes)
|
||||||
(select-shapes new-selected)
|
(select-shapes new-selected)
|
||||||
(ptk/data-event :layout/update frames)
|
(ptk/data-event :layout/update frames)
|
||||||
(memorize-duplicated id-original id-duplicated)
|
(memorize-duplicated id-original id-duplicated)
|
||||||
(dwu/commit-undo-transaction undo-id))))))))))
|
(dwu/commit-undo-transaction undo-id)))))))))
|
||||||
|
|
||||||
(defn change-hover-state
|
(defn change-hover-state
|
||||||
[id value]
|
[id value]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue