diff --git a/CHANGES.md b/CHANGES.md index 9d1fe5deb..99816a27b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -62,6 +62,7 @@ - Fix some typos [Taiga #4724](https://tree.taiga.io/project/penpot/issue/4724) - Fix ctrl+c for inspect code [Taiga #4739](https://tree.taiga.io/project/penpot/issue/4739) - Fix text in custom font is not at the expected position at export [Taiga #4394](https://tree.taiga.io/project/penpot/issue/4394) +- Fix unneeded popup when updating local components [Taiga #4430](https://tree.taiga.io/project/penpot/issue/4430) ### :heart: Community contributions by (Thank you!) diff --git a/frontend/src/app/main/ui/workspace/context_menu.cljs b/frontend/src/app/main/ui/workspace/context_menu.cljs index 9fc5c2a06..1bf722ad2 100644 --- a/frontend/src/app/main/ui/workspace/context_menu.cljs +++ b/frontend/src/app/main/ui/workspace/context_menu.cljs @@ -411,6 +411,8 @@ current-file-id (mf/use-ctx ctx/current-file-id) local-component? (= component-file current-file-id) + remote-components (filter #(not= (:component-file %) current-file-id) + component-shapes) workspace-data (deref refs/workspace-data) workspace-libraries (deref refs/workspace-libraries) @@ -442,16 +444,19 @@ :accept-style :primary :on-accept do-update-component})) - do-update-in-bulk #(st/emit! (modal/show - {:type :confirm - :message "" - :title (tr "modals.update-remote-component-in-bulk.message") - :hint (tr "modals.update-remote-component-in-bulk.hint") - :items component-shapes - :cancel-label (tr "modals.update-remote-component.cancel") - :accept-label (tr "modals.update-remote-component.accept") - :accept-style :primary - :on-accept do-update-component-in-bulk}))] + do-update-in-bulk (fn [] + (if (empty? remote-components) + (do-update-component-in-bulk) + #(st/emit! (modal/show + {:type :confirm + :message "" + :title (tr "modals.update-remote-component-in-bulk.message") + :hint (tr "modals.update-remote-component-in-bulk.hint") + :items remote-components + :cancel-label (tr "modals.update-remote-component.cancel") + :accept-label (tr "modals.update-remote-component.accept") + :accept-style :primary + :on-accept do-update-component-in-bulk}))))] [:* [:* (when (or (not is-non-root?) (and has-component? (not single?)))