format code

This commit is contained in:
2024-12-27 14:25:12 +08:00
parent f0cc8d6270
commit 4b36debd0b
66 changed files with 1485 additions and 1480 deletions

View File

@@ -12,7 +12,7 @@ export async function upgrade(
ChatStore,
StoreNames<ChatStore>[],
"versionchange"
>,
>
) {
if (oldVersion < 1) {
upgradeV1(db, oldVersion, newVersion, transaction);

View File

@@ -10,7 +10,7 @@ export async function upgradeV1(
ChatStore,
StoreNames<ChatStore>[],
"versionchange"
>,
>
) {
const store = db.createObjectStore(STORAGE_NAME, {
autoIncrement: true,
@@ -18,7 +18,7 @@ export async function upgradeV1(
// copy from localStorage to indexedDB
const allChatStoreIndexes: number[] = JSON.parse(
localStorage.getItem(STORAGE_NAME_INDEXES) ?? "[]",
localStorage.getItem(STORAGE_NAME_INDEXES) ?? "[]"
);
let keyCount = 0;
for (const i of allChatStoreIndexes) {
@@ -32,7 +32,7 @@ export async function upgradeV1(
// setSelectedChatIndex(keyCount);
if (keyCount > 0) {
alert(
"v2.0.0 Update: Imported chat history from localStorage to indexedDB. 🎉",
"v2.0.0 Update: Imported chat history from localStorage to indexedDB. 🎉"
);
}
}

View File

@@ -10,7 +10,7 @@ export async function upgradeV11(
ChatStore,
StoreNames<ChatStore>[],
"versionchange"
>,
>
) {
if (oldVersion < 11 && oldVersion >= 1) {
alert("Start upgrading storage, just a sec... (Click OK to continue)");