From da5847cc4d1e0ec691c4abd83c9245569834356a Mon Sep 17 00:00:00 2001 From: Aitor Date: Wed, 17 Jan 2024 13:12:16 +0100 Subject: [PATCH] :bug: Update module disappears without applying the changes --- frontend/src/app/main/data/workspace/libraries.cljs | 3 +-- frontend/src/app/main/ui/workspace/libraries.cljs | 7 ++++++- frontend/src/app/main/ui/workspace/libraries.scss | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/main/data/workspace/libraries.cljs b/frontend/src/app/main/data/workspace/libraries.cljs index ae2d666e8..30106467d 100644 --- a/frontend/src/app/main/data/workspace/libraries.cljs +++ b/frontend/src/app/main/data/workspace/libraries.cljs @@ -1054,8 +1054,7 @@ ignore-until (dm/get-in state [:workspace-file :ignore-sync-until]) libraries-need-sync (filter #(seq (assets-need-sync % file-data ignore-until)) (vals (get state :workspace-libraries))) - do-more-info #(do (modal/show! :libraries-dialog {:starting-tab :updates}) - (st/emit! msg/hide)) + do-more-info #(modal/show! :libraries-dialog {:starting-tab :updates}) do-update #(do (apply st/emit! (map (fn [library] (sync-file (:current-file-id state) (:id library))) diff --git a/frontend/src/app/main/ui/workspace/libraries.cljs b/frontend/src/app/main/ui/workspace/libraries.cljs index 3829f7ca3..8d6b7dcc9 100644 --- a/frontend/src/app/main/ui/workspace/libraries.cljs +++ b/frontend/src/app/main/ui/workspace/libraries.cljs @@ -481,6 +481,11 @@ on-tab-change (mf/use-fn #(reset! selected-tab* %)) + close-dialog-outside + (mf/use-fn (fn [event] + (when (= (dom/get-target event) (dom/get-current-target event)) + (modal/hide!)))) + close-dialog (mf/use-fn (fn [_] (modal/hide!) @@ -490,7 +495,7 @@ (when team-id (st/emit! (dwl/fetch-shared-files {:team-id team-id})))) - [:div {:class (stl/css :modal-overlay)} + [:div {:class (stl/css :modal-overlay) :on-click close-dialog-outside} [:div {:class (stl/css :modal-dialog)} [:button {:class (stl/css :close) :on-click close-dialog} diff --git a/frontend/src/app/main/ui/workspace/libraries.scss b/frontend/src/app/main/ui/workspace/libraries.scss index 8ebf89b74..e91cedb36 100644 --- a/frontend/src/app/main/ui/workspace/libraries.scss +++ b/frontend/src/app/main/ui/workspace/libraries.scss @@ -15,7 +15,6 @@ width: 100%; z-index: $z-index-modal; background-color: var(--overlay-color); - pointer-events: none; // This is to allow outside click that closes modal. .modal-dialog { position: relative; @@ -25,7 +24,6 @@ padding: $s-32; border-radius: $br-10; background-color: var(--modal-background-color); - pointer-events: all; .close { @extend .button-tertiary; position: absolute; @@ -146,8 +144,10 @@ .section-title { @include titleTipography; + color: var(--modal-title-foreground-color); margin-bottom: $s-12; } + .libraries-search { margin: $s-12 0; .search-icon {