Skip to content

Commit

Permalink
fix key generation
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Aug 16, 2024
1 parent 455b485 commit d0e82b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/components/P2PKDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
</q-card-section>
</div>
<q-btn
v-if="false"
class="q-mx-xs q-px-md q-mt-md"
size="md"
color="primary"
Expand Down Expand Up @@ -83,15 +82,14 @@ export default defineComponent({
return {};
},
computed: {
...mapState(useP2PKStore, ["p2pkKeys", "showP2PKData"]),
...mapState(useP2PKStore, ["p2pkKeys", "showP2PKData", "showLastKey"]),
...mapWritableState(useP2PKStore, ["showP2PKDialog"]),
},
methods: {
...mapActions(useP2PKStore, ["generateKeypair", "showKeyDetails"]),
newKeys: function () {
this.generateKeypair();
const newPubkey = this.p2pkKeys[this.p2pkKeys.length - 1].publicKey;
this.showP2PKData.publicKey = newPubkey;
this.showLastKey();
},
},
});
Expand Down
8 changes: 7 additions & 1 deletion src/stores/p2pk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ export const useP2PKStore = defineStore("p2pk", {
showKeyDetails: function (key: string) {
const thisKeys = this.p2pkKeys.filter((k) => k.publicKey == key)
if (thisKeys.length) {
this.showP2PKData = thisKeys[0];
this.showP2PKData = JSON.parse(JSON.stringify(thisKeys[0]));
this.showP2PKDialog = true;
}
},
showLastKey: function () {
if (this.p2pkKeys.length) {
this.showP2PKData = JSON.parse(JSON.stringify(this.p2pkKeys[this.p2pkKeys.length - 1]));
this.showP2PKDialog = true;
}
},
Expand Down

0 comments on commit d0e82b0

Please sign in to comment.