forked from jsnbuchanan/crowd-funder-for-time-pwa
switch the encryption secret from localStorage to IndexedDB (because localStorage gets lost so often)
This commit is contained in:
@@ -87,13 +87,18 @@ import { Component, Vue } from "vue-facing-decorator";
|
||||
import { Router } from "vue-router";
|
||||
|
||||
import { AppString, NotificationIface } from "@/constants/app";
|
||||
import { accountsDB, db, retrieveSettingsForActiveAccount } from "@/db/index";
|
||||
import {
|
||||
accountsDBPromise,
|
||||
db,
|
||||
retrieveSettingsForActiveAccount,
|
||||
} from "@/db/index";
|
||||
import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
|
||||
import {
|
||||
DEFAULT_ROOT_DERIVATION_PATH,
|
||||
deriveAddress,
|
||||
newIdentifier,
|
||||
} from "@/libs/crypto";
|
||||
import { retrieveAccountCount } from "@/libs/util";
|
||||
|
||||
@Component({
|
||||
components: {},
|
||||
@@ -118,8 +123,7 @@ export default class ImportAccountView extends Vue {
|
||||
shouldErase = false;
|
||||
|
||||
async created() {
|
||||
await accountsDB.open();
|
||||
this.numAccounts = await accountsDB.accounts.count();
|
||||
this.numAccounts = await retrieveAccountCount();
|
||||
// get the server, to help with import on the test server
|
||||
const settings = await retrieveSettingsForActiveAccount();
|
||||
this.apiServer = settings.apiServer || "";
|
||||
@@ -148,7 +152,7 @@ export default class ImportAccountView extends Vue {
|
||||
this.derivationPath,
|
||||
);
|
||||
|
||||
await accountsDB.open();
|
||||
const accountsDB = await accountsDBPromise;
|
||||
if (this.shouldErase) {
|
||||
await accountsDB.accounts.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user