aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Ángel Moreno <mail@migalmoreno.com>2024-12-19 22:38:14 +0100
committerMiguel Ángel Moreno <mail@migalmoreno.com>2024-12-19 22:39:36 +0100
commit6e0c07502ddba0817478b0ba29d768bc1dedf1e4 (patch)
tree1ca5a37d8533925c3ad9d95f9f3ece4ce6dd3baf
parent0f831aff6615c9d9ad0a58a45a159137b2aca5f8 (diff)
fix: fix persistence of unshuffled queue
-rw-r--r--src/frontend/tubo/bg_player/events.cljs4
-rw-r--r--src/frontend/tubo/queue/events.cljs7
2 files changed, 8 insertions, 3 deletions
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