aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiguel Ángel Moreno <mail@migalmoreno.com>2024-12-10 08:40:46 +0100
committerMiguel Ángel Moreno <mail@migalmoreno.com>2024-12-10 08:40:46 +0100
commit1d98e5e2780e9288e4b0ea8bfc4b46dd264146f3 (patch)
tree98012632d441a7ad0cc890488266f9815fd31c3e /src
parent42eced10dfaecc9192e2102ab3ffb00ba67f13b6 (diff)
feat: add notification when adding multiple streams to bookmark
Diffstat (limited to 'src')
-rw-r--r--src/frontend/tubo/bookmarks/events.cljs19
-rw-r--r--src/frontend/tubo/bookmarks/modals.cljs2
2 files changed, 11 insertions, 10 deletions
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