feat: update tab execution logic to handle multiple tabs with SQL queries

This commit is contained in:
t8y2 2026-05-05 12:07:02 +08:00
parent 6beae4e139
commit f0941c083e
1 changed files with 5 additions and 3 deletions

View File

@ -211,15 +211,17 @@ function initApp() {
}
async function reconnectRestoredTabs() {
if (isDesktop) return;
const connectionIds = new Set(queryStore.tabs.map(t => t.connectionId).filter(Boolean));
for (const id of connectionIds) {
try {
await connectionStore.ensureConnected(id);
} catch {}
}
const tab = queryStore.tabs.find(t => t.id === queryStore.activeTabId);
if (tab && tab.mode === "data" && tab.tableMeta) {
queryStore.executeCurrentTab();
for (const tab of queryStore.tabs) {
if (tab.mode === "data" && tab.tableMeta && tab.sql) {
queryStore.executeTabSql(tab.id, tab.sql).catch(() => {});
}
}
}