From 812ce3cc1f4886e99dbc2319121c66904c2d40d1 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Wed, 23 Apr 2025 10:21:51 +0800 Subject: [PATCH] fix: conversation list show in startup --- src/pages/App.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/App.tsx b/src/pages/App.tsx index ae6c260..1cfc8ba 100644 --- a/src/pages/App.tsx +++ b/src/pages/App.tsx @@ -217,6 +217,12 @@ export function App() { ) { 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 api = getDefaultParams("api", ""); @@ -239,12 +245,6 @@ export function App() { console.log("create new chatStore because of params in URL"); 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();