|
@ -171,6 +171,7 @@ import { createIdentifier, deriveAddress, newIdentifier } from "../libs/crypto"; |
|
|
import { IIdentifier } from "@veramo/core"; |
|
|
import { IIdentifier } from "@veramo/core"; |
|
|
import * as R from "ramda"; |
|
|
import * as R from "ramda"; |
|
|
import { db } from "../db"; |
|
|
import { db } from "../db"; |
|
|
|
|
|
import { useAppStore } from "@/store/app"; |
|
|
|
|
|
|
|
|
@Options({ |
|
|
@Options({ |
|
|
components: {}, |
|
|
components: {}, |
|
@ -185,6 +186,8 @@ export default class AccountViewView extends Vue { |
|
|
const previousIdentifiers: Array<IIdentifier> = []; |
|
|
const previousIdentifiers: Array<IIdentifier> = []; |
|
|
const toLowercase = true; |
|
|
const toLowercase = true; |
|
|
|
|
|
|
|
|
|
|
|
const appCondition = useAppStore().condition; |
|
|
|
|
|
if (appCondition == "uninitialized") { |
|
|
this.mnemonic = createIdentifier(); |
|
|
this.mnemonic = createIdentifier(); |
|
|
[ |
|
|
[ |
|
|
this.address, |
|
|
this.address, |
|
@ -235,12 +238,7 @@ export default class AccountViewView extends Vue { |
|
|
dateCreated: new Date().getTime(), |
|
|
dateCreated: new Date().getTime(), |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
const accounts = await db.accounts.toArray(); |
|
|
useAppStore().setCondition("registered"); |
|
|
console.log(accounts[0]); |
|
|
|
|
|
const identity = JSON.parse(accounts[0].identity); |
|
|
|
|
|
|
|
|
|
|
|
this.address = identity.did; |
|
|
|
|
|
this.publicHex = identity.keys[0].publicKeyHex; |
|
|
|
|
|
|
|
|
|
|
|
//appStore.dispatch(appSlice.actions.addLog({log: false, msg: "... created new ID..."})) |
|
|
//appStore.dispatch(appSlice.actions.addLog({log: false, msg: "... created new ID..."})) |
|
|
//appStore.dispatch(appSlice.actions.addLog({log: false, msg: "... stored new ID..."})) |
|
|
//appStore.dispatch(appSlice.actions.addLog({log: false, msg: "... stored new ID..."})) |
|
@ -249,5 +247,17 @@ export default class AccountViewView extends Vue { |
|
|
console.log(err); |
|
|
console.log(err); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
await db.open(); |
|
|
|
|
|
const num_accounts = await db.accounts.count(); |
|
|
|
|
|
if (num_accounts === 0) { |
|
|
|
|
|
console.log("Problem! Should have a profile!"); |
|
|
|
|
|
} else { |
|
|
|
|
|
const accounts = await db.accounts.toArray(); |
|
|
|
|
|
console.log(accounts[0]); |
|
|
|
|
|
const identity = JSON.parse(accounts[0].identity); |
|
|
|
|
|
this.address = identity.did; |
|
|
|
|
|
this.publicHex = identity.keys[0].publicKeyHex; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|