convert all remaining DB writes & reads to SQL (with successful registration & claim)

This commit is contained in:
2025-05-27 21:07:24 -06:00
parent b18112b869
commit 8d1511e38f
67 changed files with 1200 additions and 266 deletions

View File

@@ -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);