mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-01 20:42:50 +08:00
feat(scope): lock Navbar selector to scoped bot + apply scope on load
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
88ac7d2a68
commit
463a8e2f8a
2 files changed
+89
-5
No files matched your search
+7
-2
@@ -140,12 +140,17 @@ function cycleMobileMode() {
|
||||
playerStore.setMode(nextMode);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
playerStore.loadTheme();
|
||||
connect();
|
||||
playerStore.fetchBots();
|
||||
syncTimer = setInterval(() => playerStore.syncElapsed(), 3000);
|
||||
mobileRaf = requestAnimationFrame(updateMobileProgress);
|
||||
// Reconcile the dedicated-link scope only after the bot list is known: the
|
||||
// router guard sets scopedBotId tentatively from ?bot, but applyScopeFromQuery
|
||||
// validates it against the loaded bots (locks if it exists, clears if stale).
|
||||
await playerStore.fetchBots();
|
||||
const qBot = typeof route.query.bot === 'string' ? route.query.bot : null;
|
||||
playerStore.applyScopeFromQuery(qBot);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
|
||||
Reference in new issue
Block a user