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:
@@ -624,7 +624,8 @@ import TopMessage from "../components/TopMessage.vue";
|
||||
import QuickNav from "../components/QuickNav.vue";
|
||||
import EntityIcon from "../components/EntityIcon.vue";
|
||||
import ProjectIcon from "../components/ProjectIcon.vue";
|
||||
import { NotificationIface } from "../constants/app";
|
||||
import { NotificationIface, USE_DEXIE_DB } from "../constants/app";
|
||||
import * as databaseUtil from "../db/databaseUtil";
|
||||
import {
|
||||
db,
|
||||
logConsoleAndDb,
|
||||
@@ -636,6 +637,7 @@ import * as serverUtil from "../libs/endorserServer";
|
||||
import { retrieveAccountDids } from "../libs/util";
|
||||
import HiddenDidDialog from "../components/HiddenDidDialog.vue";
|
||||
import { logger } from "../utils/logger";
|
||||
import { PlatformServiceFactory } from "@/services/PlatformServiceFactory";
|
||||
/**
|
||||
* Project View Component
|
||||
* @author Matthew Raymer
|
||||
@@ -778,10 +780,21 @@ export default class ProjectViewView extends Vue {
|
||||
* @emits Notification on profile loading errors
|
||||
*/
|
||||
async created() {
|
||||
const settings = await retrieveSettingsForActiveAccount();
|
||||
let settings = await databaseUtil.retrieveSettingsForActiveAccount();
|
||||
if (USE_DEXIE_DB) {
|
||||
settings = await retrieveSettingsForActiveAccount();
|
||||
}
|
||||
this.activeDid = settings.activeDid || "";
|
||||
this.apiServer = settings.apiServer || "";
|
||||
this.allContacts = await db.contacts.toArray();
|
||||
const platformService = PlatformServiceFactory.getInstance();
|
||||
const queryResult = await platformService.dbQuery("SELECT * FROM contacts");
|
||||
this.allContacts = databaseUtil.mapQueryResultToValues(
|
||||
queryResult,
|
||||
) as unknown as Contact[];
|
||||
if (USE_DEXIE_DB) {
|
||||
await db.open();
|
||||
this.allContacts = await db.contacts.toArray();
|
||||
}
|
||||
this.isRegistered = !!settings.isRegistered;
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user