Fix: 优化 SQL 库启动加载

Co-authored-by: staff <staff@qimaos-MacBook-Pro.local>
This commit is contained in:
zipgandstaff authored and GitHub committed 2026-06-27 15:07:26 +08:00
1 parent c289dda97d
commit b85b14bfde
18 files changed
+397 -42

No files matched your search

+11 -4
View File
@@ -867,8 +867,8 @@ async function openConnectionQuery(connectionId: string) {
}
}
function openSavedSqlFromWelcome(fileId: string) {
const file = savedSqlStore.getFile(fileId);
async function openSavedSqlFromWelcome(fileId: string) {
const file = await savedSqlStore.ensureFileContent(fileId);
if (!file) return;
queryStore.openSavedSql(file);
connectionStore.activeConnectionId = file.connectionId;
@@ -1273,9 +1273,16 @@ function initApp() {
settingsStore
.initDesktopSettings()
.catch(() => {})
.then(() => savedSqlStore.initFromStorage())
.then(() => {
console.log(`[STARTUP] savedSqlStore.initFromStorage: ${(performance.now() - t0).toFixed(0)}ms`);
void 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);
});
return connectionStore.initFromDisk();
})
.then(() => {