fix some errors and correct recent type duplications & bloat (cherry-picked from d8f2587d1c)

This commit is contained in:
2025-05-31 22:36:15 -06:00
parent 4327a5175c
commit 24cfeca1eb
16 changed files with 264 additions and 346 deletions

View File

@@ -168,15 +168,11 @@ export default class IdentitySwitcherView extends Vue {
if (did === "0") {
did = undefined;
}
const platformService = PlatformServiceFactory.getInstance();
await platformService.dbExec(
`UPDATE settings SET activeDid = ? WHERE id = ?`,
[did ?? "", MASTER_SETTINGS_KEY],
);
await databaseUtil.updateDefaultSettings({ activeDid: did });
if (USE_DEXIE_DB) {
await db.open();
await db.settings.update(MASTER_SETTINGS_KEY, {
activeDid: did ?? "",
activeDid: did,
});
}
this.$router.push({ name: "account" });
@@ -190,9 +186,16 @@ export default class IdentitySwitcherView extends Vue {
title: "Delete Identity?",
text: "Are you sure you want to erase this identity? (There is no undo. You may want to select it and back it up just in case.)",
onYes: async () => {
// one of the few times we use accountsDBPromise directly; try to avoid more usage
const accountsDB = await accountsDBPromise;
await accountsDB.accounts.delete(id);
const platformService = PlatformServiceFactory.getInstance();
await platformService.dbExec(
`DELETE FROM accounts WHERE id = ?`,
[id],
);
if (USE_DEXIE_DB) {
// one of the few times we use accountsDBPromise directly; try to avoid more usage
const accountsDB = await accountsDBPromise;
await accountsDB.accounts.delete(id);
}
this.otherIdentities = this.otherIdentities.filter(
(ident) => ident.id !== id,
);