From 3f458638238aa9afef040c0b4e8f68d5b096ddc5 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 18 Feb 2025 12:03:56 +0100 Subject: [PATCH] :bug: Fix update-libraries dialog disappear when clicking outside --- CHANGES.md | 1 + frontend/src/app/main/data/notifications.cljs | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1f100b86d9..a9550c037d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -66,6 +66,7 @@ is a number of cores) - Fix problem with onboarding to a team [Taiga #10143](https://tree.taiga.io/project/penpot/issue/10143) - Fix problem with grid layout crashing [Taiga #10127](https://tree.taiga.io/project/penpot/issue/10127) - Fix rename locked boards [Taiga #10174](https://tree.taiga.io/project/penpot/issue/10174) +- Fix update-libraries dialog disappear when clicking outside [Taiga #10238](https://tree.taiga.io/project/penpot/issue/10238) ## 2.4.3 diff --git a/frontend/src/app/main/data/notifications.cljs b/frontend/src/app/main/data/notifications.cljs index 703d8df68e..37caee0ba2 100644 --- a/frontend/src/app/main/data/notifications.cljs +++ b/frontend/src/app/main/data/notifications.cljs @@ -65,12 +65,16 @@ (assoc state :notification notification))) ptk/WatchEvent - (watch [_ _ stream] + (watch [_ state stream] (rx/merge - (let [stopper (rx/filter (ptk/type? ::hide) stream)] + (let [stopper (rx/filter (ptk/type? ::hide) stream) + route-id (dm/get-in state [:route :data :name])] + (->> stream (rx/filter (ptk/type? :app.main.router/navigate)) - (rx/map (fn [_] (hide))) + (rx/map deref) + (rx/filter #(not= route-id (:id %))) + (rx/map hide) (rx/take-until stopper))) (when (:timeout data) (let [stopper (rx/filter (ptk/type? ::show) stream)]