mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-14 06:36:46 +00:00
17 lines
537 B
JavaScript
17 lines
537 B
JavaScript
export default (livewireComponent) => ({
|
|
|
|
signThisEvent: livewireComponent.entangle('signThisEvent'),
|
|
showLog: livewireComponent.entangle('showLog', true),
|
|
|
|
init() {
|
|
// on change of signThisEvent, call the method
|
|
this.$watch('signThisEvent', async () => {
|
|
const toBeSigned = JSON.parse(this.signThisEvent);
|
|
console.log(toBeSigned);
|
|
const signedEvent = await window.nostr.signEvent(toBeSigned);
|
|
this.$wire.call('signEvent', signedEvent);
|
|
});
|
|
},
|
|
|
|
});
|