perf: service worker lifecycle method (#21532)

Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
Udit TakkarandAlex van Andel authored and GitHub committed 2025-05-27 23:12:25 +00:00
1 parent 71a5d8b261
commit e5868837d5
2 files changed
+17 -12

No files matched your search

@@ -91,6 +91,11 @@ export function NotificationSoundHandler() {
// Don't automatically initialize - wait for user interaction
return () => {
stopSound();
if (audioContextRef.current && audioContextRef.current.state !== "closed") {
audioContextRef.current.close();
}
audioContextRef.current = null;
audioBufferRef.current = null;
};
}, []);