IndexedDB migration: implement the migrations differently

This commit is contained in:
2025-06-19 17:26:30 -06:00
parent 4e215914a3
commit 37f2ba1382
6 changed files with 181 additions and 496 deletions

View File

@@ -1021,12 +1021,12 @@ export async function importFromMnemonic(
// Create new identifier
const newId = newIdentifier(address, publicHex, privateHex, derivationPath);
// Handle database operations
const accountsDB = await accountsDBPromise;
// Handle erasures
if (shouldErase) {
const platformService = PlatformServiceFactory.getInstance();
await platformService.dbExec("DELETE FROM accounts");
if (USE_DEXIE_DB) {
const accountsDB = await accountsDBPromise;
await accountsDB.accounts.clear();
}
}