From af90842e72a4e786b1cab083cb38f95743f3c344 Mon Sep 17 00:00:00 2001 From: zurdi Date: Thu, 17 Sep 2026 17:59:47 +0200 Subject: [PATCH] fix(v2): pause music when the viewport shrinks to a phone mid-game Addresses Copilot's review note: the pause only watched the game stage, so a desktop window narrowed to phone width while a game ran kept playing with the top-bar controls hidden. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01S76JZm1jjh32KhBbPCBvGW --- frontend/src/v2/components/Soundtrack/MiniPlayer.vue | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/frontend/src/v2/components/Soundtrack/MiniPlayer.vue b/frontend/src/v2/components/Soundtrack/MiniPlayer.vue index 49c9e1564..e987ad5e4 100644 --- a/frontend/src/v2/components/Soundtrack/MiniPlayer.vue +++ b/frontend/src/v2/components/Soundtrack/MiniPlayer.vue @@ -26,12 +26,9 @@ const audioEl = ref(null); // On phones the mini player lives in the top bar, which a running game hides, // so the music pauses rather than play on with no controls. -watch( - () => playingStore.stageActive, - (active) => { - if (active && smAndDown.value) audioEl.value?.pause(); - }, -); +watch([() => playingStore.stageActive, smAndDown], ([active, phone]) => { + if (active && phone) audioEl.value?.pause(); +}); // Generation token — bumped every time we reassign `src`. Any async // `play()` promise resolves against the token current when it was