fix: conversation list show in startup

This commit is contained in:
2025-04-23 10:21:51 +08:00
parent 667b334dfc
commit 812ce3cc1f

View File

@@ -217,6 +217,12 @@ export function App() {
) { ) {
setShowImportDialog(true); setShowImportDialog(true);
} }
await db;
const allidx = await (await db).getAllKeys(STORAGE_NAME);
if (allidx.length === 0) {
handleNewChatStore();
}
setAllChatStoreIndexes(await (await db).getAllKeys(STORAGE_NAME));
/* /*
const chatStore = await getChatStoreByIndex(selectedChatIndex); const chatStore = await getChatStoreByIndex(selectedChatIndex);
const api = getDefaultParams("api", ""); const api = getDefaultParams("api", "");
@@ -239,12 +245,6 @@ export function App() {
console.log("create new chatStore because of params in URL"); console.log("create new chatStore because of params in URL");
handleNewChatStoreWithOldOne(chatStore); handleNewChatStoreWithOldOne(chatStore);
} }
await db;
const allidx = await (await db).getAllKeys(STORAGE_NAME);
if (allidx.length === 0) {
handleNewChatStore();
}
setAllChatStoreIndexes(await (await db).getAllKeys(STORAGE_NAME));
*/ */
}; };
run(); run();