fix(sql-library): hydrate restored tabs after startup
This commit is contained in:
3 files changed
+48
-2
No files matched your search
@@ -3895,13 +3895,14 @@ function onLoginSuccess() {
|
||||
async function initApp() {
|
||||
const t0 = performance.now();
|
||||
console.log("[STARTUP] initApp begin");
|
||||
void Promise.all([initSavedSqlEditorPositions(), savedSqlStore.initFromStorage()])
|
||||
const savedSqlInitialization = Promise.all([initSavedSqlEditorPositions(), savedSqlStore.initFromStorage()])
|
||||
.then(() => {
|
||||
console.log(`[STARTUP] savedSqlStore.initFromStorage: ${(performance.now() - t0).toFixed(0)}ms`);
|
||||
void queryStore.hydrateSavedSqlTabs();
|
||||
return true;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
toast(t("connection.loadFailed", { message: e?.message || String(e) }), 5000);
|
||||
return false;
|
||||
});
|
||||
|
||||
const restoreOpenTabs = async () => {
|
||||
@@ -3931,6 +3932,13 @@ async function initApp() {
|
||||
onOptionalStateError: (error) => console.error("[STARTUP] settingsStore.initAiConfigs failed", error),
|
||||
});
|
||||
}
|
||||
void savedSqlInitialization
|
||||
.then((initialized) => {
|
||||
if (initialized) return queryStore.hydrateSavedSqlTabs();
|
||||
})
|
||||
.catch((e: any) => {
|
||||
toast(t("connection.loadFailed", { message: e?.message || String(e) }), 5000);
|
||||
});
|
||||
await runPendingComponentUpdatesBeforePluginReconnect({
|
||||
hasPendingComponentUpdates: () => !isDetachedWindowContext && hasPendingComponentUpdatesAfterAppRestart(),
|
||||
prepareStartup: async () => {
|
||||
|
||||
Reference in new issue
Block a user