From 2afb483aa03596ad8ac3000a225d1f0670ed020a Mon Sep 17 00:00:00 2001 From: Carifio24 Date: Tue, 9 Jun 2026 01:45:54 -0400 Subject: [PATCH] Add watcher for playing flag. --- src/SeasonsStory.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/SeasonsStory.vue b/src/SeasonsStory.vue index b6ad939..dfa0ea7 100644 --- a/src/SeasonsStory.vue +++ b/src/SeasonsStory.vue @@ -371,8 +371,6 @@ :icon="playing ? 'pause' : 'play'" @activate="() => { playing = !playing; - store.setClockRate(playing ? 1000 : 0); - store.setClockSync(playing); handlePlaying(playing); }" :tooltip-text="playing ? 'Pause' : 'Play'" @@ -1727,9 +1725,9 @@ watch(selectedLocation, (location: LocationDeg, oldLocation: LocationDeg) => { resetView(); }); -watch(currentTime, (_time: Date) => { +watch(currentTime, (time: Date) => { // Auto-pause when time reaches sunset or sunrise, accounting for playing direction - if (playing.value && ((_time.getTime() >= endTime.value && store.clockRate >= 0) || ( _time.getTime() <= startTime.value && store.clockRate <= 0))) { + if (playing.value && ((time.getTime() >= endTime.value && store.clockRate >= 0) || ( time.getTime() <= startTime.value && store.clockRate <= 0))) { playing.value = false; return; } @@ -1739,6 +1737,11 @@ watch(currentTime, (_time: Date) => { sunDistance.value = sunPlace.get_distance(); }); +watch(playing, (play: boolean) => { + store.setClockRate(play ? 1000 : 0); + store.setClockSync(play); +}); + watch(forceCamera, (value: boolean) => { if (value) { resetView();