Skip to content

Commit

Permalink
fix(useBell): add console debugging statements to help fix Sentry error
Browse files Browse the repository at this point in the history
  • Loading branch information
benji6 committed Nov 11, 2024
1 parent b0ee6a4 commit 38bad41
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,26 @@ export default function useBell(): Bell | undefined {

bellRef.current = {
async start() {
console.debug("stop");
stop();
console.debug("createBufferSource");
bufferSource = audioContext.createBufferSource();
console.debug("connect");
bufferSource.connect(audioContext.destination);
console.debug("await buffer promise");
bufferSource.buffer = await audioBufferPromise;
console.debug("onended");
bufferSource.onended = stop;
console.debug("start");
bufferSource.start();
},
stop() {
if (!bufferSource) return;
console.debug("stop");
bufferSource.stop();
console.debug("disconnect");
bufferSource.disconnect();
console.debug("stopped");
bufferSource = undefined;
},
};
Expand Down

0 comments on commit 38bad41

Please sign in to comment.