Browse Source

update a DB save to match others, ie. first SQL then maybe Dexie

pull/137/head
Trent Larson 1 day ago
parent
commit
38e67f3533
  1. 11
      src/views/IdentitySwitcherView.vue

11
src/views/IdentitySwitcherView.vue

@ -172,17 +172,16 @@ export default class IdentitySwitcherView extends Vue {
if (did === "0") { if (did === "0") {
did = undefined; did = undefined;
} }
if (USE_DEXIE_DB) {
await db.open();
await db.settings.update(MASTER_SETTINGS_KEY, {
activeDid: did ?? "",
});
} else {
const platformService = PlatformServiceFactory.getInstance(); const platformService = PlatformServiceFactory.getInstance();
await platformService.dbExec( await platformService.dbExec(
`UPDATE settings SET activeDid = ? WHERE id = ?`, `UPDATE settings SET activeDid = ? WHERE id = ?`,
[did ?? "", MASTER_SETTINGS_KEY], [did ?? "", MASTER_SETTINGS_KEY],
); );
if (USE_DEXIE_DB) {
await db.open();
await db.settings.update(MASTER_SETTINGS_KEY, {
activeDid: did ?? "",
});
} }
this.$router.push({ name: "account" }); this.$router.push({ name: "account" });
} }

Loading…
Cancel
Save