added saving

This commit is contained in:
Daniel Ledda
2023-02-26 22:41:46 +01:00
parent 766faf5f56
commit e05c95a673
5 changed files with 36 additions and 20 deletions

View File

@@ -20,7 +20,7 @@ export function createBeatStore() {
const activeBeatIndex = ref(0);
const activeBeat = computed<Beat | null>(() => beats.value[activeBeatIndex.value] ?? null);
const autoSave = ref(true);
const orientation = ref<'horizontal' | 'vertical' | null>(null);
const orientation = ref<'horizontal' | 'vertical'>('horizontal');
function resetActiveBeat(): void {
const current = activeBeat.value;
@@ -51,7 +51,7 @@ export function createBeatStore() {
localStorage.setItem("drum-slayer-save", JSON.stringify({
beats: serials,
activeBeatIndex: activeBeatIndex.value,
orientation: orientation.value,
orientation: orientation.value ?? 'horizontal',
}));
}
}