refactor: cleanup store (#727)

* refactor: isolate clock

* refactor: isolate private

* refactor: remove duplicate

* chore: rename loaded > runtime

* fix: handle no events loaded
This commit is contained in:
Carlos Valente
2024-01-24 00:20:10 +01:00
committed by GitHub
parent 0cd2ca4191
commit b4ad533e6a
31 changed files with 411 additions and 384 deletions
+5 -5
View File
@@ -22,11 +22,11 @@ export class TimerService {
}
start() {
if (!state.runtime.selectedEventId) {
if (!state.eventNow) {
return;
}
if (state.playback === Playback.Play) {
if (state.timer.playback === Playback.Play) {
return;
}
@@ -36,14 +36,14 @@ export class TimerService {
}
pause() {
if (state.playback !== Playback.Play) {
if (state.timer.playback !== Playback.Play) {
return;
}
stateMutations.timer.pause();
}
stop() {
if (state.playback === Playback.Stop) {
if (state.timer.playback === Playback.Stop) {
return;
}
stateMutations.timer.stop();
@@ -54,7 +54,7 @@ export class TimerService {
* @param {number} amount
*/
addTime(amount: number) {
if (state.runtime.selectedEventId === null) {
if (state.eventNow === null) {
return;
}
stateMutations.timer.addTime(amount);