Merge pull request #4190 from penpot/palba-bugfixes-002

🐛 Fix impossible to move an element when it's in a main component
This commit is contained in:
Alejandro 2024-02-27 08:53:06 +01:00 committed by GitHub
commit addf83ab22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 68 additions and 184 deletions

View file

@ -133,14 +133,29 @@
(st/emit! (dd/fetch-recent-files team-id)
(dd/clear-selected-files))))
on-move-accept
(fn [params team-id project-id]
(st/emit! (dd/move-files
(with-meta params
{:on-success #(on-move-success team-id project-id)}))))
on-move
(fn [team-id project-id]
(let [params {:ids (into #{} (map :id) files)
:project-id project-id}]
(fn []
(st/emit! (dd/move-files
(with-meta params
{:on-success #(on-move-success team-id project-id)}))))))
(let [num-shared (filter #(:is-shared %) files)]
(if (and (< 0 (count num-shared))
(not= team-id current-team-id))
(st/emit! (modal/show
{:type :delete-shared-libraries
:origin :move
:ids (into #{} (map :id) files)
:on-accept #(on-move-accept params team-id project-id)
:count-libraries (count num-shared)}))
(on-move-accept params team-id project-id))))))
add-shared
#(st/emit! (dd/set-file-shared (assoc file :is-shared true)))