mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-14 06:36:46 +00:00
voting system with nostr added
This commit is contained in:
15
resources/js/nostrApp.js
Normal file
15
resources/js/nostrApp.js
Normal file
@@ -0,0 +1,15 @@
|
||||
export default (livewireComponent) => ({
|
||||
|
||||
signThisEvent: livewireComponent.entangle('signThisEvent'),
|
||||
|
||||
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);
|
||||
});
|
||||
},
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user