From e89ae187808c3143fc456869d56e7867bfa9f923 Mon Sep 17 00:00:00 2001 From: Frank Stellmacher Date: Wed, 22 Apr 2026 13:32:59 +0200 Subject: [PATCH] fix(server-switch): keep cached playback alive + Settings tab-id typo (#262) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(server-switch): keep cached playback alive across servers Drop the clearQueue() + initializeFromServerQueue() calls that were added alongside the header server switcher (c75297fc). clearQueue() fires audio_stop, killing the currently-playing (cached) track the moment the user clicks a different server. Restore the pre-c75297fc behaviour: just swap activeServerId, let the Rust audio engine keep streaming the already-resolved URL, and let the next user action or the app-boot hook pick up the new server's saved queue. Co-Authored-By: Claude Opus 4.7 (1M context) * fix(settings): use renamed 'servers' tab id in paste-invite handler Leftover from #261 landing on top of #259 — the Settings tab was renamed from 'server' to 'servers' in #259, but the openAddServerInvite route-state handler still used the old literal. Caused a TS error and meant pasting a psysonic1- invite did not actually switch tabs. Co-Authored-By: Claude Opus 4.7 (1M context) --------- Co-authored-by: Psychotoxical Co-authored-by: Claude Opus 4.7 (1M context) --- src/pages/Settings.tsx | 4 ++-- src/utils/switchActiveServer.ts | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index d62dc054..7319f89e 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -1441,10 +1441,10 @@ export default function Settings() { if (inv) { setPastedServerInvite(inv); setShowAddForm(true); - setActiveTab('server'); + setActiveTab('servers'); navigate( { pathname: location.pathname, search: location.search, hash: location.hash }, - { replace: true, state: { tab: 'server' as Tab } }, + { replace: true, state: { tab: 'servers' as Tab } }, ); return; } diff --git a/src/utils/switchActiveServer.ts b/src/utils/switchActiveServer.ts index a3215985..fe13552c 100644 --- a/src/utils/switchActiveServer.ts +++ b/src/utils/switchActiveServer.ts @@ -1,12 +1,7 @@ import { pingWithCredentials, scheduleInstantMixProbeForServer } from '../api/subsonic'; import type { ServerProfile } from '../store/authStore'; import { useAuthStore } from '../store/authStore'; -import { usePlayerStore } from '../store/playerStore'; -/** - * Ping, update server identity / Instant Mix probe, set active server, clear local playback - * and pull the new server's saved play queue. - */ export async function switchActiveServer(server: ServerProfile): Promise { try { const ping = await pingWithCredentials(server.url, server.username, server.password); @@ -21,8 +16,6 @@ export async function switchActiveServer(server: ServerProfile): Promise