fix(app): avoid reconnecting restored tabs

This commit is contained in:
t8y2 2026-06-16 00:19:06 +08:00
parent e4246d204c
commit 54620e1f22
1 changed files with 2 additions and 5 deletions

View File

@ -992,7 +992,7 @@ function initApp() {
})
.then(() => {
console.log(`[STARTUP] connectionStore.initFromDisk: ${(performance.now() - t0).toFixed(0)}ms`);
reconnectRestoredTabs();
restoreActiveConnectionContext();
})
.catch((e: any) => {
toast(t("connection.loadFailed", { message: e?.message || String(e) }), 5000);
@ -1000,13 +1000,10 @@ function initApp() {
settingsStore.initAiConfig();
}
async function reconnectRestoredTabs() {
function restoreActiveConnectionContext() {
const activeConnectionId = activeTab.value?.connectionId || connectionStore.activeConnectionId;
if (activeConnectionId && connectionStore.getConfig(activeConnectionId)) {
connectionStore.activeConnectionId = activeConnectionId;
try {
await connectionStore.ensureConnected(activeConnectionId);
} catch {}
}
}