summaryrefslogtreecommitdiff
path: root/src/store/audioStore.ts
diff options
context:
space:
mode:
authorSolstice <solstice@local>2026-06-09 01:10:46 -0700
committerSolstice <solstice@local>2026-06-09 01:10:46 -0700
commit887c0bc6f968f80ac90220f24bb578438e05708a (patch)
tree563925e9bc82ae0eee582dc9128ea753d0082ab0 /src/store/audioStore.ts
parent4e2d978eb5fc9457d5b913bc10faf1266e6dcda4 (diff)
fix: resolve final release blockers
Diffstat (limited to 'src/store/audioStore.ts')
-rw-r--r--src/store/audioStore.ts14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/store/audioStore.ts b/src/store/audioStore.ts
index 39cbf8b..36d593d 100644
--- a/src/store/audioStore.ts
+++ b/src/store/audioStore.ts
@@ -53,15 +53,15 @@ export const useAudioStore = create<AudioStore>((set, get) => ({
try {
if (sound === 'none') {
await invoke('stop_ambient');
- set({ playing: false, sound: 'none' });
+ await get().fetchStatus();
return;
}
await invoke('play_ambient', { sound });
- set({ available: true, playing: true, sound });
+ await get().fetchStatus();
} catch (error) {
console.error('play_ambient error:', error);
- set({ available: false, playing: false, sound: 'none' });
+ await get().fetchStatus();
}
},
@@ -71,14 +71,10 @@ export const useAudioStore = create<AudioStore>((set, get) => ({
try {
await invoke('set_ambient_volume', { volume: nextVolume });
- set({ available: true });
+ await get().fetchStatus();
} catch (error) {
console.error('set_ambient_volume error:', error);
- set({
- available: false,
- playing: false,
- sound: get().sound,
- });
+ await get().fetchStatus();
}
},
}));