separate account from other data for backup/restore

This commit is contained in:
2023-03-19 16:25:19 -06:00
parent fb44c8aa48
commit 45b54db01e
14 changed files with 99 additions and 95 deletions

View File

@@ -140,8 +140,8 @@ import { Options, Vue } from "vue-class-component";
import { AppString } from "@/constants/app";
import { accessToken, SimpleSigner } from "@/libs/crypto";
import { IIdentifier } from "@veramo/core";
import { db } from "../db";
import { Contact } from "../db/tables";
import { accountsDB, db } from "../db";
import { Contact } from "../db/tables/contacts";
export interface GiveVerifiableCredential {
"@context": string;
@@ -169,9 +169,11 @@ export default class ContactsView extends Vue {
// 'created' hook runs when the Vue instance is first created
async created() {
await db.open();
const accounts = await db.accounts.toArray();
await accountsDB.open();
const accounts = await accountsDB.accounts.toArray();
this.identity = JSON.parse(accounts[0].identity);
await db.open();
this.contacts = await db.contacts.toArray();
const params = new URLSearchParams(window.location.search);