fix(sql-library): load saved files earlier at startup

This commit is contained in:
t8y2 committed 2026-09-25 14:06:37 +08:00
1 parent cb16b0f8be
commit b99c60aff6
5 files changed
+63 -16

No files matched your search

+9 -9
View File
@@ -3870,6 +3870,15 @@ function onLoginSuccess() {
async function initApp() {
const t0 = performance.now();
console.log("[STARTUP] initApp begin");
void Promise.all([initSavedSqlEditorPositions(), savedSqlStore.initFromStorage()])
.then(() => {
console.log(`[STARTUP] savedSqlStore.initFromStorage: ${(performance.now() - t0).toFixed(0)}ms`);
void queryStore.hydrateSavedSqlTabs();
})
.catch((e: any) => {
toast(t("connection.loadFailed", { message: e?.message || String(e) }), 5000);
});
const restoreOpenTabs = async () => {
await settingsStore.initEditorSettings();
markStartupPhase("settings-ready");
@@ -3916,15 +3925,6 @@ async function initApp() {
void promptTemplateStore.init();
void Promise.all([initSavedSqlEditorPositions(), savedSqlStore.initFromStorage()])
.then(() => {
console.log(`[STARTUP] savedSqlStore.initFromStorage: ${(performance.now() - t0).toFixed(0)}ms`);
void queryStore.hydrateSavedSqlTabs();
})
.catch((e: any) => {
toast(t("connection.loadFailed", { message: e?.message || String(e) }), 5000);
});
restoreActiveConnectionContext();
} catch (e: any) {
toast(t("connection.loadFailed", { message: e?.message || String(e) }), 5000);