From 66055a0b149907e4be1e08ff26f7fc08853753d0 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Fri, 21 Oct 2022 16:25:25 +0200 Subject: [PATCH] :sparkles: Confirm unpublish library on libraries popup --- frontend/src/app/main/ui/workspace/libraries.cljs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/workspace/libraries.cljs b/frontend/src/app/main/ui/workspace/libraries.cljs index 52f0909b7..11d3aa465 100644 --- a/frontend/src/app/main/ui/workspace/libraries.cljs +++ b/frontend/src/app/main/ui/workspace/libraries.cljs @@ -7,6 +7,7 @@ (ns app.main.ui.workspace.libraries (:require [app.common.data :as d] + [app.main.data.dashboard :as dd] [app.main.data.modal :as modal] [app.main.data.workspace.libraries :as dwl] [app.main.refs :as refs] @@ -87,7 +88,16 @@ del-shared (mf/use-callback (mf/deps file) - #(st/emit! (dwl/set-file-shared (:id file) false)))] + (fn [_] + (st/emit! (dd/fetch-libraries-using-files [file])) + (st/emit! (modal/show + {:type :delete-shared + :origin :unpublish + :on-accept (fn[] + (st/emit! (dwl/set-file-shared (:id file) false)) + (modal/show! :libraries-dialog {})) + :on-cancel #(modal/show! :libraries-dialog {}) + :count-libraries 1}))))] [:* [:div.section [:div.section-title (tr "workspace.libraries.in-this-file")]