From 363c1d5b56a701ce6e3ab5e2fb3e6edc4011f0b5 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 12 Mar 2025 12:08:42 +0100 Subject: [PATCH] :bug: Fix sync libraries of components --- CHANGES.md | 14 ++++++++++++++ .../src/app/main/data/workspace/libraries.cljs | 5 ++--- .../src/app/main/data/workspace/notifications.cljs | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index dc422a8d2..a8a0feace 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,19 @@ # CHANGELOG +## 2.5.3 + +### :rocket: Epics and highlights + +### :boom: Breaking changes & Deprecations + +### :heart: Community contributions (Thank you!) + +### :sparkles: New features + +### :bug: Bugs fixed + +- Component sync issues with multiple tabs [Taiga #10471](https://tree.taiga.io/project/penpot/issue/10471) + ## 2.5.2 ### :rocket: Epics and highlights diff --git a/frontend/src/app/main/data/workspace/libraries.cljs b/frontend/src/app/main/data/workspace/libraries.cljs index d4a57d21e..c9ffdaddb 100644 --- a/frontend/src/app/main/data/workspace/libraries.cljs +++ b/frontend/src/app/main/data/workspace/libraries.cljs @@ -1186,20 +1186,19 @@ (ctf/used-assets-changed-since file-data library sync-date)))))) (defn notify-sync-file + ;; file-id is the id of the modified library [file-id] (dm/assert! (uuid? file-id)) (ptk/reify ::notify-sync-file ptk/WatchEvent (watch [_ state _] - (let [file (dsh/lookup-file state file-id) - + (let [file (dsh/lookup-file state (:current-file-id state)) file-data (get file :data) ignore-until (get file :ignore-sync-until) libraries-need-sync (filter #(seq (assets-need-sync % file-data ignore-until)) (vals (get state :files))) - do-more-info #(modal/show! :libraries-dialog {:starting-tab "updates" :file-id file-id}) diff --git a/frontend/src/app/main/data/workspace/notifications.cljs b/frontend/src/app/main/data/workspace/notifications.cljs index f5e85bce2..e62985f70 100644 --- a/frontend/src/app/main/data/workspace/notifications.cljs +++ b/frontend/src/app/main/data/workspace/notifications.cljs @@ -317,6 +317,6 @@ (ptk/reify ::handle-library-change ptk/WatchEvent (watch [_ state _] - (when (contains? (:libraries state) file-id) + (when (contains? (:files state) file-id) (rx/of (dwl/ext-library-changed file-id modified-at revn changes) (dwl/notify-sync-file file-id))))))