From 1a1f365cf10b4cd588df6d1f56166f3121870879 Mon Sep 17 00:00:00 2001 From: saopig1 <4x7sw862st@gmail.com> Date: Tue, 16 Jun 2026 14:43:18 +0800 Subject: [PATCH] fix(scope): clear scope when the scoped bot is removed [#82 review] removeBotStatus (botRemoved WS frame or admin deleting the scoped bot) left scopedBotId dangling: isScoped stayed true, displayedBots went empty, and activeBot silently fell back to bots[0], locking the UI onto a phantom bot. Clear the scope when the scoped bot disappears. --- web/src/stores/player.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/src/stores/player.ts b/web/src/stores/player.ts index 47ea4e0..00ddf11 100644 --- a/web/src/stores/player.ts +++ b/web/src/stores/player.ts @@ -202,6 +202,11 @@ export const usePlayerStore = defineStore('player', { this.bots = this.bots.filter((b) => b.id !== botId); delete this.queues[botId]; delete this.timings[botId]; + // If the bot we were locked to is gone, drop the scope so the UI does not + // stay 'locked' onto a phantom (activeBot would silently fall back to bots[0]). + if (this.scopedBotId === botId) { + this.clearScope(); + } }, setQueue(botId: string, queue: Song[]) {