From a737c125d5a49724d933d817fc656e3cf4a7b488 Mon Sep 17 00:00:00 2001 From: Eva Date: Mon, 3 Jul 2023 10:46:38 +0200 Subject: [PATCH] :bug: Fix unpublish more than one library at the same time --- CHANGES.md | 1 + .../src/app/main/ui/dashboard/file_menu.cljs | 40 ++++++++++--------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 88a5ef670..ad3a2f569 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -24,6 +24,7 @@ - Fix files can be opened from multiple urls [Taiga #5310](https://tree.taiga.io/project/penpot/issue/5310) - Fix asset color item was created from the selected layer [Taiga #5180](https://tree.taiga.io/project/penpot/issue/5180) +- Fix unpublish more than one library at the same time [Taiga #5532](https://tree.taiga.io/project/penpot/issue/5532) ### :arrow_up: Deps updates diff --git a/frontend/src/app/main/ui/dashboard/file_menu.cljs b/frontend/src/app/main/ui/dashboard/file_menu.cljs index cea4baf06..23726875e 100644 --- a/frontend/src/app/main/ui/dashboard/file_menu.cljs +++ b/frontend/src/app/main/ui/dashboard/file_menu.cljs @@ -142,7 +142,11 @@ #(st/emit! (dd/set-file-shared (assoc file :is-shared true))) del-shared - #(st/emit! (dd/set-file-shared (assoc file :is-shared false))) + (mf/use-fn + (mf/deps files) + (fn [_] + (run! #(st/emit! (dd/set-file-shared (assoc % :is-shared false))) files))) + on-add-shared (fn [event] @@ -216,23 +220,23 @@ (when current-team (let [sub-options (concat (vec (for [project current-projects] - {:option-name (get-project-name project) - :id (get-project-id project) - :option-handler (on-move (:id current-team) - (:id project))})) - (when (seq other-teams) - [{:option-name (tr "dashboard.move-to-other-team") - :id "move-to-other-team" - :sub-options - (for [team other-teams] - {:option-name (get-team-name team) - :id (get-project-id team) - :sub-options - (for [sub-project (:projects team)] - {:option-name (get-project-name sub-project) - :id (get-project-id sub-project) - :option-handler (on-move (:id team) - (:id sub-project))})})}])) + {:option-name (get-project-name project) + :id (get-project-id project) + :option-handler (on-move (:id current-team) + (:id project))})) + (when (seq other-teams) + [{:option-name (tr "dashboard.move-to-other-team") + :id "move-to-other-team" + :sub-options + (for [team other-teams] + {:option-name (get-team-name team) + :id (get-project-id team) + :sub-options + (for [sub-project (:projects team)] + {:option-name (get-project-name sub-project) + :id (get-project-id sub-project) + :option-handler (on-move (:id team) + (:id sub-project))})})}])) options (if multi? [{:option-name (tr "dashboard.duplicate-multi" file-count)