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

@@ -103,7 +103,7 @@
<script lang="ts">
import { Options, Vue } from "vue-class-component";
import { accessToken } from "@/libs/crypto";
import { db } from "../db";
import { accountsDB } from "../db";
import { IIdentifier } from "@veramo/core";
import { AppString } from "@/constants/app";
@@ -155,12 +155,12 @@ export default class ProjectsView extends Vue {
// 'created' hook runs when the Vue instance is first created
async created() {
await db.open();
const num_accounts = await db.accounts.count();
await accountsDB.open();
const num_accounts = await accountsDB.accounts.count();
if (num_accounts === 0) {
console.log("Problem! Should have a profile!");
} else {
const accounts = await db.accounts.toArray();
const accounts = await accountsDB.accounts.toArray();
const identity = JSON.parse(accounts[0].identity);
this.LoadProjects(identity);
}