Browse Source

await all of the db.settings updates

playwright-pwa-install-test
Trent Larson 4 months ago
parent
commit
f362f19cbb
  1. 12
      src/components/FeedFilters.vue
  2. 4
      src/db/index.ts
  3. 4
      src/views/ContactQRScanShowView.vue
  4. 6
      src/views/ContactsView.vue
  5. 6
      src/views/HomeView.vue
  6. 2
      src/views/ImportAccountView.vue
  7. 2
      src/views/ImportDerivedAccountView.vue
  8. 4
      src/views/NewEditAccountView.vue
  9. 4
      src/views/SearchAreaView.vue
  10. 2
      src/views/SharedPhotoView.vue

12
src/components/FeedFilters.vue

@ -133,18 +133,18 @@ export default class FeedFilters extends Vue {
this.visible = true; this.visible = true;
} }
toggleHasVisibleDid() { async toggleHasVisibleDid() {
this.settingChanged = true; this.settingChanged = true;
this.hasVisibleDid = !this.hasVisibleDid; this.hasVisibleDid = !this.hasVisibleDid;
db.settings.update(MASTER_SETTINGS_KEY, { await db.settings.update(MASTER_SETTINGS_KEY, {
filterFeedByVisible: this.hasVisibleDid, filterFeedByVisible: this.hasVisibleDid,
}); });
} }
toggleNearby() { async toggleNearby() {
this.settingChanged = true; this.settingChanged = true;
this.isNearby = !this.isNearby; this.isNearby = !this.isNearby;
db.settings.update(MASTER_SETTINGS_KEY, { await db.settings.update(MASTER_SETTINGS_KEY, {
filterFeedByNearby: this.isNearby, filterFeedByNearby: this.isNearby,
}); });
} }
@ -154,7 +154,7 @@ export default class FeedFilters extends Vue {
this.settingChanged = true; this.settingChanged = true;
} }
db.settings.update(MASTER_SETTINGS_KEY, { await db.settings.update(MASTER_SETTINGS_KEY, {
filterFeedByNearby: false, filterFeedByNearby: false,
filterFeedByVisible: false, filterFeedByVisible: false,
}); });
@ -168,7 +168,7 @@ export default class FeedFilters extends Vue {
this.settingChanged = true; this.settingChanged = true;
} }
db.settings.update(MASTER_SETTINGS_KEY, { await db.settings.update(MASTER_SETTINGS_KEY, {
filterFeedByNearby: true, filterFeedByNearby: true,
filterFeedByVisible: true, filterFeedByVisible: true,
}); });

4
src/db/index.ts

@ -51,8 +51,8 @@ db.version(2).stores({
db.version(3).stores(TempSchema); db.version(3).stores(TempSchema);
// Event handler to initialize the non-sensitive database with default settings // Event handler to initialize the non-sensitive database with default settings
db.on("populate", () => { db.on("populate", async () => {
db.settings.add({ await db.settings.add({
id: MASTER_SETTINGS_KEY, id: MASTER_SETTINGS_KEY,
apiServer: DEFAULT_ENDORSER_API_SERVER, apiServer: DEFAULT_ENDORSER_API_SERVER,
}); });

4
src/views/ContactQRScanShowView.vue

@ -278,7 +278,7 @@ export default class ContactQRScanShow extends Vue {
text: "Do you want to register them?", text: "Do you want to register them?",
onCancel: async (stopAsking: boolean) => { onCancel: async (stopAsking: boolean) => {
if (stopAsking) { if (stopAsking) {
db.settings.update(MASTER_SETTINGS_KEY, { await db.settings.update(MASTER_SETTINGS_KEY, {
hideRegisterPromptOnNewContact: stopAsking, hideRegisterPromptOnNewContact: stopAsking,
}); });
this.hideRegisterPromptOnNewContact = stopAsking; this.hideRegisterPromptOnNewContact = stopAsking;
@ -286,7 +286,7 @@ export default class ContactQRScanShow extends Vue {
}, },
onNo: async (stopAsking: boolean) => { onNo: async (stopAsking: boolean) => {
if (stopAsking) { if (stopAsking) {
db.settings.update(MASTER_SETTINGS_KEY, { await db.settings.update(MASTER_SETTINGS_KEY, {
hideRegisterPromptOnNewContact: stopAsking, hideRegisterPromptOnNewContact: stopAsking,
}); });
this.hideRegisterPromptOnNewContact = stopAsking; this.hideRegisterPromptOnNewContact = stopAsking;

6
src/views/ContactsView.vue

@ -691,7 +691,7 @@ export default class ContactsView extends Vue {
text: "Do you want to register them?", text: "Do you want to register them?",
onCancel: async (stopAsking: boolean) => { onCancel: async (stopAsking: boolean) => {
if (stopAsking) { if (stopAsking) {
db.settings.update(MASTER_SETTINGS_KEY, { await db.settings.update(MASTER_SETTINGS_KEY, {
hideRegisterPromptOnNewContact: stopAsking, hideRegisterPromptOnNewContact: stopAsking,
}); });
this.hideRegisterPromptOnNewContact = stopAsking; this.hideRegisterPromptOnNewContact = stopAsking;
@ -699,7 +699,7 @@ export default class ContactsView extends Vue {
}, },
onNo: async (stopAsking: boolean) => { onNo: async (stopAsking: boolean) => {
if (stopAsking) { if (stopAsking) {
db.settings.update(MASTER_SETTINGS_KEY, { await db.settings.update(MASTER_SETTINGS_KEY, {
hideRegisterPromptOnNewContact: stopAsking, hideRegisterPromptOnNewContact: stopAsking,
}); });
this.hideRegisterPromptOnNewContact = stopAsking; this.hideRegisterPromptOnNewContact = stopAsking;
@ -1109,7 +1109,7 @@ export default class ContactsView extends Vue {
const newShowValue = !this.showGiveNumbers; const newShowValue = !this.showGiveNumbers;
try { try {
await db.open(); await db.open();
db.settings.update(MASTER_SETTINGS_KEY, { await db.settings.update(MASTER_SETTINGS_KEY, {
showContactGivesInline: newShowValue, showContactGivesInline: newShowValue,
}); });
} catch (err) { } catch (err) {

6
src/views/HomeView.vue

@ -89,7 +89,7 @@
:to="{ name: 'contact-qr' }" :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" 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
</router-link> </router-link>
<div v-if="PASSKEYS_ENABLED" class="flex justify-end w-full"> <div v-if="PASSKEYS_ENABLED" class="flex justify-end w-full">
<router-link <router-link
@ -435,7 +435,7 @@ export default class HomeView extends Vue {
if (resp.status === 200) { if (resp.status === 200) {
// we just needed to know that they're registered // we just needed to know that they're registered
await db.open(); await db.open();
db.settings.update(MASTER_SETTINGS_KEY, { await db.settings.update(MASTER_SETTINGS_KEY, {
isRegistered: true, isRegistered: true,
}); });
this.isRegistered = true; this.isRegistered = true;
@ -597,7 +597,7 @@ export default class HomeView extends Vue {
this.feedLastViewedClaimId < results.data[0].jwtId this.feedLastViewedClaimId < results.data[0].jwtId
) { ) {
await db.open(); await db.open();
db.settings.update(MASTER_SETTINGS_KEY, { await db.settings.update(MASTER_SETTINGS_KEY, {
lastViewedClaimId: results.data[0].jwtId, lastViewedClaimId: results.data[0].jwtId,
}); });
} }

2
src/views/ImportAccountView.vue

@ -143,7 +143,7 @@ export default class ImportAccountView extends Vue {
// record that as the active DID // record that as the active DID
await db.open(); await db.open();
db.settings.update(MASTER_SETTINGS_KEY, { await db.settings.update(MASTER_SETTINGS_KEY, {
activeDid: newId.did, activeDid: newId.did,
}); });
this.$router.push({ name: "account" }); this.$router.push({ name: "account" });

2
src/views/ImportDerivedAccountView.vue

@ -144,7 +144,7 @@ export default class ImportAccountView extends Vue {
// record that as the active DID // record that as the active DID
await db.open(); await db.open();
db.settings.update(MASTER_SETTINGS_KEY, { await db.settings.update(MASTER_SETTINGS_KEY, {
activeDid: newId.did, activeDid: newId.did,
}); });
this.$router.push({ name: "account" }); this.$router.push({ name: "account" });

4
src/views/NewEditAccountView.vue

@ -63,8 +63,8 @@ export default class NewEditAccountView extends Vue {
(settings?.lastName ? ` ${settings.lastName}` : ""); // deprecated, pre v 0.1.3 (settings?.lastName ? ` ${settings.lastName}` : ""); // deprecated, pre v 0.1.3
} }
onClickSaveChanges() { async onClickSaveChanges() {
db.settings.update(MASTER_SETTINGS_KEY, { await db.settings.update(MASTER_SETTINGS_KEY, {
firstName: this.givenName, firstName: this.givenName,
lastName: "", // deprecated, pre v 0.1.3 lastName: "", // deprecated, pre v 0.1.3
}); });

4
src/views/SearchAreaView.vue

@ -198,7 +198,7 @@ export default class DiscoverView extends Vue {
}, },
}; };
await db.open(); await db.open();
db.settings.update(MASTER_SETTINGS_KEY, { await db.settings.update(MASTER_SETTINGS_KEY, {
searchBoxes: [newSearchBox], searchBoxes: [newSearchBox],
}); });
this.searchBox = newSearchBox; this.searchBox = newSearchBox;
@ -245,7 +245,7 @@ export default class DiscoverView extends Vue {
public async forgetSearchBox() { public async forgetSearchBox() {
try { try {
await db.open(); await db.open();
db.settings.update(MASTER_SETTINGS_KEY, { await db.settings.update(MASTER_SETTINGS_KEY, {
searchBoxes: [], searchBoxes: [],
filterFeedByNearby: false, filterFeedByNearby: false,
}); });

2
src/views/SharedPhotoView.vue

@ -127,7 +127,7 @@ export default class SharedPhotoView extends Vue {
recordProfile() { recordProfile() {
(this.$refs.photoDialog as PhotoDialog).open( (this.$refs.photoDialog as PhotoDialog).open(
async (imgUrl) => { async (imgUrl) => {
db.settings.update(MASTER_SETTINGS_KEY, { await db.settings.update(MASTER_SETTINGS_KEY, {
profileImageUrl: imgUrl, profileImageUrl: imgUrl,
}); });
this.$router.push({ name: "account" }); this.$router.push({ name: "account" });

Loading…
Cancel
Save