forked from jsnbuchanan/crowd-funder-for-time-pwa
convert all remaining DB writes & reads to SQL (with successful registration & claim)
This commit is contained in:
@@ -539,7 +539,12 @@ export default class ContactsView extends Vue {
|
||||
if (response.status != 201) {
|
||||
throw { error: { response: response } };
|
||||
}
|
||||
await updateAccountSettings(this.activeDid, { isRegistered: true });
|
||||
await databaseUtil.updateAccountSettings(this.activeDid, {
|
||||
isRegistered: true,
|
||||
});
|
||||
if (USE_DEXIE_DB) {
|
||||
await updateAccountSettings(this.activeDid, { isRegistered: true });
|
||||
}
|
||||
this.isRegistered = true;
|
||||
this.$notify(
|
||||
{
|
||||
@@ -990,6 +995,8 @@ export default class ContactsView extends Vue {
|
||||
newContact as unknown as Record<string, unknown>,
|
||||
"contacts",
|
||||
);
|
||||
console.log("sql", sql);
|
||||
console.log("params", params);
|
||||
let contactPromise = platformService.dbExec(sql, params);
|
||||
if (USE_DEXIE_DB) {
|
||||
// @ts-expect-error since the result of this promise won't be used, and this will go away soon
|
||||
@@ -1023,17 +1030,27 @@ export default class ContactsView extends Vue {
|
||||
text: "Do you want to register them?",
|
||||
onCancel: async (stopAsking?: boolean) => {
|
||||
if (stopAsking) {
|
||||
await updateDefaultSettings({
|
||||
await databaseUtil.updateDefaultSettings({
|
||||
hideRegisterPromptOnNewContact: stopAsking,
|
||||
});
|
||||
if (USE_DEXIE_DB) {
|
||||
await updateDefaultSettings({
|
||||
hideRegisterPromptOnNewContact: stopAsking,
|
||||
});
|
||||
}
|
||||
this.hideRegisterPromptOnNewContact = stopAsking;
|
||||
}
|
||||
},
|
||||
onNo: async (stopAsking?: boolean) => {
|
||||
if (stopAsking) {
|
||||
await updateDefaultSettings({
|
||||
await databaseUtil.updateDefaultSettings({
|
||||
hideRegisterPromptOnNewContact: stopAsking,
|
||||
});
|
||||
if (USE_DEXIE_DB) {
|
||||
await updateDefaultSettings({
|
||||
hideRegisterPromptOnNewContact: stopAsking,
|
||||
});
|
||||
}
|
||||
this.hideRegisterPromptOnNewContact = stopAsking;
|
||||
}
|
||||
},
|
||||
@@ -1327,9 +1344,14 @@ export default class ContactsView extends Vue {
|
||||
private async toggleShowContactAmounts() {
|
||||
const newShowValue = !this.showGiveNumbers;
|
||||
try {
|
||||
await updateDefaultSettings({
|
||||
await databaseUtil.updateDefaultSettings({
|
||||
showContactGivesInline: newShowValue,
|
||||
});
|
||||
if (USE_DEXIE_DB) {
|
||||
await updateDefaultSettings({
|
||||
showContactGivesInline: newShowValue,
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
const fullError =
|
||||
"Error updating contact-amounts setting: " + errorStringForLog(err);
|
||||
|
||||
Reference in New Issue
Block a user