Sound error fixed#3961
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughGameRightSidebar adds Howler audio context resumption to its exit dialog cancel flow. When the user cancels the exit confirmation, the handler now registers a window focus listener and schedules a timeout to resume the suspended Web Audio context before returning. ChangesAudio Context Resumption
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description:
Sound bug fixed: When the button to exit a game is clicked and the action is canceled in the confirmation dialog, the background music and sound effects stop playing for the rest of the game.
Clicking "Exit" brings up a native browser confirmation dialog. This dialog causes the window to lose focus, and the browser takes the opportunity to suspend Howler's audio context. The curious thing is that this suspension doesn't happen while the dialog is open, but right after closing it. If you confirmed, it wasn't noticeable because the page reloaded anyway. But if you canceled, you were left in the game with the audio suspended, and nothing could reactivate it, so the music and sound effects were muted for the rest of the game.
Canceling simply resumes the audio if it was paused. Since the pause occurs a moment late, it's not enough to do it immediately; we do it when the window regains focus (which is precisely when the dialogue closes) and, just in case, with a short timer backup. This way, the sound returns automatically and the game continues normally.
Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
sardidefcon