Compare commits
1 Commits
3405325cbb
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48a73246a1 |
@@ -77,7 +77,12 @@ export function useWaveform(
|
||||
};
|
||||
|
||||
initializeAudio();
|
||||
}, [options.url, options.songId, options.bandId]);
|
||||
// containerRef is a stable ref object — safe to include.
|
||||
// options.onReady is intentionally omitted: it's a callback that callers
|
||||
// may not memoize, and re-running initialization on every render would be
|
||||
// worse than stale-closing over it for the brief window after mount.
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [options.url, options.songId, options.bandId, containerRef]);
|
||||
|
||||
const play = () => {
|
||||
audioService.play(options.songId ?? null, options.bandId ?? null)
|
||||
|
||||
@@ -392,7 +392,7 @@ export function SongPage() {
|
||||
};
|
||||
window.addEventListener("keydown", handleKeyDown);
|
||||
return () => window.removeEventListener("keydown", handleKeyDown);
|
||||
}, [isPlaying, play, pause]);
|
||||
}, [isPlaying, isReady, play, pause]);
|
||||
|
||||
// ── Comments ─────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class AudioService {
|
||||
// For use in tests only
|
||||
public static resetInstance(): void {
|
||||
this.instance?.cleanup();
|
||||
this.instance = undefined as any;
|
||||
this.instance = undefined as unknown as AudioService;
|
||||
}
|
||||
|
||||
private createMediaElement(): HTMLAudioElement {
|
||||
|
||||
Reference in New Issue
Block a user