forked from trent_larson/crowd-funder-for-time-pwa
switch the encryption secret from localStorage to IndexedDB (because localStorage gets lost so often)
This commit is contained in:
@@ -78,8 +78,9 @@ import {
|
||||
newIdentifier,
|
||||
nextDerivationPath,
|
||||
} from "@/libs/crypto";
|
||||
import { accountsDB, db } from "@/db/index";
|
||||
import { accountsDBPromise, db } from "@/db/index";
|
||||
import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
|
||||
import { retrieveAllFullyDecryptedAccounts } from "@/libs/util";
|
||||
|
||||
@Component({
|
||||
components: {},
|
||||
@@ -90,8 +91,7 @@ export default class ImportAccountView extends Vue {
|
||||
selectedArrayFirstDid = "";
|
||||
|
||||
async mounted() {
|
||||
await accountsDB.open();
|
||||
const accounts = await accountsDB.accounts.toArray();
|
||||
const accounts = await retrieveAllFullyDecryptedAccounts(); // let's match derived accounts differently so we don't need the private info
|
||||
const seedDids: Record<string, Array<string>> = {};
|
||||
accounts.forEach((account) => {
|
||||
const prevDids: Array<string> = seedDids[account.mnemonic] || [];
|
||||
@@ -110,11 +110,11 @@ export default class ImportAccountView extends Vue {
|
||||
}
|
||||
|
||||
public async incrementDerivation() {
|
||||
await accountsDB.open();
|
||||
// find the maximum derivation path for the selected DIDs
|
||||
const selectedArray: Array<string> =
|
||||
this.didArrays.find((dids) => dids[0] === this.selectedArrayFirstDid) ||
|
||||
[];
|
||||
const accountsDB = await accountsDBPromise; // let's match derived accounts differently so we don't need the private info
|
||||
const allMatchingAccounts = await accountsDB.accounts
|
||||
.where("did")
|
||||
.anyOf(...selectedArray)
|
||||
|
||||
Reference in New Issue
Block a user