forked from jsnbuchanan/crowd-funder-for-time-pwa
In transition ... experimenting
This commit is contained in:
@@ -172,9 +172,7 @@ import { useAccountStore } from "../store/account";
|
||||
import { createIdentifier, deriveAddress, newIdentifier } from "../libs/crypto";
|
||||
import { IIdentifier } from "@veramo/core";
|
||||
import * as R from "ramda";
|
||||
import useDBAccounts from "@/use/useDBAccounts";
|
||||
|
||||
const { addAccount } = useDBAccounts();
|
||||
import { db } from "../db";
|
||||
|
||||
@Options({
|
||||
components: {},
|
||||
@@ -222,8 +220,23 @@ export default class AccountViewView extends Vue {
|
||||
privateHex,
|
||||
UPORT_ROOT_DERIVATION_PATH
|
||||
);
|
||||
console.log(newId);
|
||||
addAccount("me", "you", "identity");
|
||||
db.open().catch(function (err) {
|
||||
console.error("Failed to open db: " + (err.stack || err));
|
||||
});
|
||||
db.accounts
|
||||
.add({
|
||||
publicKey: newId.keys[0].publicKeyHex,
|
||||
identity: JSON.stringify(newId),
|
||||
})
|
||||
.then(function () {
|
||||
db.accounts.each(function (account) {
|
||||
console.log("Found close friend: " + account.publicKey);
|
||||
});
|
||||
})
|
||||
.catch(function (e) {
|
||||
// Something failed. It may be already in the open() call.
|
||||
console.error(e.stack || e);
|
||||
});
|
||||
//appStore.dispatch(appSlice.actions.addLog({log: false, msg: "... created new ID..."}))
|
||||
accountStore.account = JSON.stringify(newId);
|
||||
//appStore.dispatch(appSlice.actions.addLog({log: false, msg: "... stored new ID..."}))
|
||||
|
||||
Reference in New Issue
Block a user