feat: implemented playback looping; fixed an linter error in Toolbar.tsx

This commit is contained in:
Xiaohan-Tian
2026-01-23 15:34:26 -08:00
parent b767d2176f
commit 1c8361d45b
3 changed files with 22 additions and 12 deletions
+7 -1
View File
@@ -573,7 +573,13 @@ export const useProjectStore = create<ProjectState>((set, get) => {
},
toggleLoop: () => {
const { isLooping, loopingRange, maxBars } = get();
const { isLooping, loopingRange, maxBars, isPlaying, stopPlaying } = get();
// Stop playback if currently playing
if (isPlaying) {
stopPlaying();
}
toggleLoop(isLooping, loopingRange, maxBars);
},