From 1d98e5e2780e9288e4b0ea8bfc4b46dd264146f3 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Tue, 10 Dec 2024 08:40:46 +0100 Subject: feat: add notification when adding multiple streams to bookmark --- src/frontend/tubo/bookmarks/events.cljs | 19 ++++++++++--------- src/frontend/tubo/bookmarks/modals.cljs | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/frontend/tubo/bookmarks/events.cljs b/src/frontend/tubo/bookmarks/events.cljs index eb5a9b4..a3c1b9a 100644 --- a/src/frontend/tubo/bookmarks/events.cljs +++ b/src/frontend/tubo/bookmarks/events.cljs @@ -120,18 +120,19 @@ (rf/reg-event-fx :bookmark/add-n - (fn [_ [_ bookmark items]] + (fn [_ [_ bookmark items notify?]] {:fx (conj (map (fn [item] [:dispatch [:bookmark/add bookmark item]]) items) - [:dispatch - [:notifications/add - {:status-text (str "Added " - (count items) - " items to playlist \"" - (:name bookmark) - "\"") - :failure :success}]])})) + (when notify? + [:dispatch + [:notifications/add + {:status-text (str "Added " + (count items) + " items to playlist \"" + (:name bookmark) + "\"") + :failure :success}]]))})) (rf/reg-event-fx :bookmark/add diff --git a/src/frontend/tubo/bookmarks/modals.cljs b/src/frontend/tubo/bookmarks/modals.cljs index d4bce78..e424191 100644 --- a/src/frontend/tubo/bookmarks/modals.cljs +++ b/src/frontend/tubo/bookmarks/modals.cljs @@ -9,7 +9,7 @@ [{:keys [items name] :as bookmark} item] [:div.flex.w-full.h-24.rounded.px-2.cursor-pointer.hover:bg-neutral-100.dark:hover:bg-neutral-800 {:on-click #(rf/dispatch [(if (vector? item) :bookmark/add-n :bookmark/add) - bookmark item])} + bookmark item true])} [:div.w-24 [layout/thumbnail (-> items -- cgit v1.2.3