From f362f19cbbc4f46ef433e47b5ca45bd60b76ead8 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sat, 20 Jul 2024 07:19:27 -0600 Subject: [PATCH] await all of the db.settings updates --- src/components/FeedFilters.vue | 12 ++++++------ src/db/index.ts | 4 ++-- src/views/ContactQRScanShowView.vue | 4 ++-- src/views/ContactsView.vue | 6 +++--- src/views/HomeView.vue | 6 +++--- src/views/ImportAccountView.vue | 2 +- src/views/ImportDerivedAccountView.vue | 2 +- src/views/NewEditAccountView.vue | 4 ++-- src/views/SearchAreaView.vue | 4 ++-- src/views/SharedPhotoView.vue | 2 +- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/components/FeedFilters.vue b/src/components/FeedFilters.vue index e9cbac1..e9581fc 100644 --- a/src/components/FeedFilters.vue +++ b/src/components/FeedFilters.vue @@ -133,18 +133,18 @@ export default class FeedFilters extends Vue { this.visible = true; } - toggleHasVisibleDid() { + async toggleHasVisibleDid() { this.settingChanged = true; this.hasVisibleDid = !this.hasVisibleDid; - db.settings.update(MASTER_SETTINGS_KEY, { + await db.settings.update(MASTER_SETTINGS_KEY, { filterFeedByVisible: this.hasVisibleDid, }); } - toggleNearby() { + async toggleNearby() { this.settingChanged = true; this.isNearby = !this.isNearby; - db.settings.update(MASTER_SETTINGS_KEY, { + await db.settings.update(MASTER_SETTINGS_KEY, { filterFeedByNearby: this.isNearby, }); } @@ -154,7 +154,7 @@ export default class FeedFilters extends Vue { this.settingChanged = true; } - db.settings.update(MASTER_SETTINGS_KEY, { + await db.settings.update(MASTER_SETTINGS_KEY, { filterFeedByNearby: false, filterFeedByVisible: false, }); @@ -168,7 +168,7 @@ export default class FeedFilters extends Vue { this.settingChanged = true; } - db.settings.update(MASTER_SETTINGS_KEY, { + await db.settings.update(MASTER_SETTINGS_KEY, { filterFeedByNearby: true, filterFeedByVisible: true, }); diff --git a/src/db/index.ts b/src/db/index.ts index 6bb59f2..7d60ebf 100644 --- a/src/db/index.ts +++ b/src/db/index.ts @@ -51,8 +51,8 @@ db.version(2).stores({ db.version(3).stores(TempSchema); // Event handler to initialize the non-sensitive database with default settings -db.on("populate", () => { - db.settings.add({ +db.on("populate", async () => { + await db.settings.add({ id: MASTER_SETTINGS_KEY, apiServer: DEFAULT_ENDORSER_API_SERVER, }); diff --git a/src/views/ContactQRScanShowView.vue b/src/views/ContactQRScanShowView.vue index 0a7109c..4490211 100644 --- a/src/views/ContactQRScanShowView.vue +++ b/src/views/ContactQRScanShowView.vue @@ -278,7 +278,7 @@ export default class ContactQRScanShow extends Vue { text: "Do you want to register them?", onCancel: async (stopAsking: boolean) => { if (stopAsking) { - db.settings.update(MASTER_SETTINGS_KEY, { + await db.settings.update(MASTER_SETTINGS_KEY, { hideRegisterPromptOnNewContact: stopAsking, }); this.hideRegisterPromptOnNewContact = stopAsking; @@ -286,7 +286,7 @@ export default class ContactQRScanShow extends Vue { }, onNo: async (stopAsking: boolean) => { if (stopAsking) { - db.settings.update(MASTER_SETTINGS_KEY, { + await db.settings.update(MASTER_SETTINGS_KEY, { hideRegisterPromptOnNewContact: stopAsking, }); this.hideRegisterPromptOnNewContact = stopAsking; diff --git a/src/views/ContactsView.vue b/src/views/ContactsView.vue index b2dea9f..183cc58 100644 --- a/src/views/ContactsView.vue +++ b/src/views/ContactsView.vue @@ -691,7 +691,7 @@ export default class ContactsView extends Vue { text: "Do you want to register them?", onCancel: async (stopAsking: boolean) => { if (stopAsking) { - db.settings.update(MASTER_SETTINGS_KEY, { + await db.settings.update(MASTER_SETTINGS_KEY, { hideRegisterPromptOnNewContact: stopAsking, }); this.hideRegisterPromptOnNewContact = stopAsking; @@ -699,7 +699,7 @@ export default class ContactsView extends Vue { }, onNo: async (stopAsking: boolean) => { if (stopAsking) { - db.settings.update(MASTER_SETTINGS_KEY, { + await db.settings.update(MASTER_SETTINGS_KEY, { hideRegisterPromptOnNewContact: stopAsking, }); this.hideRegisterPromptOnNewContact = stopAsking; @@ -1109,7 +1109,7 @@ export default class ContactsView extends Vue { const newShowValue = !this.showGiveNumbers; try { await db.open(); - db.settings.update(MASTER_SETTINGS_KEY, { + await db.settings.update(MASTER_SETTINGS_KEY, { showContactGivesInline: newShowValue, }); } catch (err) { diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 785e57d..178f0a1 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -89,7 +89,7 @@ :to="{ name: 'contact-qr' }" class="block text-center text-md font-bold bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white mt-2 px-2 py-3 rounded-md" > - Show Them Default Identifier Info + Show Them {{ PASSKEYS_ENABLED ? "Default" : "Your" }} Identifier Info
{ - db.settings.update(MASTER_SETTINGS_KEY, { + await db.settings.update(MASTER_SETTINGS_KEY, { profileImageUrl: imgUrl, }); this.$router.push({ name: "account" });