From 6e0c07502ddba0817478b0ba29d768bc1dedf1e4 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Thu, 19 Dec 2024 22:38:14 +0100 Subject: fix: fix persistence of unshuffled queue --- src/frontend/tubo/bg_player/events.cljs | 4 +++- src/frontend/tubo/queue/events.cljs | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/frontend/tubo/bg_player/events.cljs b/src/frontend/tubo/bg_player/events.cljs index 044c687..e7dcce8 100644 --- a/src/frontend/tubo/bg_player/events.cljs +++ b/src/frontend/tubo/bg_player/events.cljs @@ -56,7 +56,9 @@ (fn [elem] (-> elem (assoc :queue []) - (assoc :queue/position 0)))] + (assoc :queue/unshuffled nil) + (assoc :queue/position 0) + (assoc :player/shuffled false)))] {:db (remove-entries db) :store (remove-entries store) :fx [[:dispatch [:bg-player/pause true]] diff --git a/src/frontend/tubo/queue/events.cljs b/src/frontend/tubo/queue/events.cljs index 1a452bf..7774783 100644 --- a/src/frontend/tubo/queue/events.cljs +++ b/src/frontend/tubo/queue/events.cljs @@ -37,8 +37,11 @@ (if val shuffled-queue unshuffled-queue))] {:db (assoc updated-db :player/shuffled val - :queue/unshuffled unshuffled-queue) - :store (assoc store :queue (:queue updated-db) :player/shuffled val)}))) + :queue/unshuffled (if val unshuffled-queue nil)) + :store (assoc store + :queue (:queue updated-db) + :queue/unshuffled (if val unshuffled-queue nil) + :player/shuffled val)}))) (rf/reg-event-fx :queue/add -- cgit v1.2.3