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:
@@ -180,7 +180,7 @@ import { RouteLocationNormalizedLoaded, Router } from "vue-router";
|
||||
|
||||
import QuickNav from "../components/QuickNav.vue";
|
||||
import TopMessage from "../components/TopMessage.vue";
|
||||
import { NotificationIface } from "../constants/app";
|
||||
import { NotificationIface, USE_DEXIE_DB } from "../constants/app";
|
||||
import { db, retrieveSettingsForActiveAccount } from "../db/index";
|
||||
import { GenericCredWrapper, OfferVerifiableCredential } from "../interfaces";
|
||||
import {
|
||||
@@ -193,6 +193,10 @@ import {
|
||||
import * as libsUtil from "../libs/util";
|
||||
import { retrieveAccountDids } from "../libs/util";
|
||||
import { logger } from "../utils/logger";
|
||||
import { PlatformServiceFactory } from "@/services/PlatformServiceFactory";
|
||||
import { Contact } from "@/db/tables/contacts";
|
||||
import * as databaseUtil from "../db/databaseUtil";
|
||||
|
||||
/**
|
||||
* Offer Details View Component
|
||||
* @author Matthew Raymer
|
||||
@@ -398,7 +402,10 @@ export default class OfferDetailsView extends Vue {
|
||||
* @throws Will not throw but logs errors
|
||||
*/
|
||||
private async loadAccountSettings() {
|
||||
const settings = await retrieveSettingsForActiveAccount();
|
||||
let settings = await databaseUtil.retrieveSettingsForActiveAccount();
|
||||
if (USE_DEXIE_DB) {
|
||||
settings = await retrieveSettingsForActiveAccount();
|
||||
}
|
||||
this.apiServer = settings.apiServer ?? "";
|
||||
this.activeDid = settings.activeDid ?? "";
|
||||
this.showGeneralAdvanced = settings.showGeneralAdvanced ?? false;
|
||||
@@ -409,7 +416,18 @@ export default class OfferDetailsView extends Vue {
|
||||
*/
|
||||
private async loadRecipientInfo() {
|
||||
if (this.recipientDid && !this.recipientName) {
|
||||
const allContacts = await db.contacts.toArray();
|
||||
let allContacts: Contact[] = [];
|
||||
const platformService = PlatformServiceFactory.getInstance();
|
||||
const queryResult = await platformService.dbQuery(
|
||||
"SELECT * FROM contacts",
|
||||
);
|
||||
allContacts = databaseUtil.mapQueryResultToValues(
|
||||
queryResult,
|
||||
) as unknown as Contact[];
|
||||
if (USE_DEXIE_DB) {
|
||||
await db.open();
|
||||
allContacts = await db.contacts.toArray();
|
||||
}
|
||||
const allMyDids = await retrieveAccountDids();
|
||||
this.recipientName = didInfo(
|
||||
this.recipientDid,
|
||||
|
||||
Reference in New Issue
Block a user