From 2386e6f2e9aea85390e827a56e10159f7ffb01d2 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Tue, 14 May 2024 18:56:40 +0800 Subject: [PATCH] Update storage version to 11 and add alert during upgrade --- src/app.tsx | 5 +++-- src/search.tsx | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app.tsx b/src/app.tsx index de9e270..33e9754 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -198,7 +198,7 @@ export function App() { localStorage.setItem(STORAGE_NAME_SELECTED, `${selectedChatIndex}`); }, [selectedChatIndex]); - const db = openDB(STORAGE_NAME, 10, { + const db = openDB(STORAGE_NAME, 11, { async upgrade(db, oldVersion, newVersion, transaction) { if (oldVersion < 1) { const store = db.createObjectStore(STORAGE_NAME, { @@ -226,7 +226,8 @@ export function App() { } } - if (oldVersion < 10) { + if (oldVersion < 11) { + alert("Start upgrading storage, just a sec... (Click OK to continue)"); if ( transaction .objectStore(STORAGE_NAME) diff --git a/src/search.tsx b/src/search.tsx index 78caf45..80d2904 100644 --- a/src/search.tsx +++ b/src/search.tsx @@ -33,7 +33,12 @@ export default function Search(props: { >
Search - +