Files
einundzwanzig-verein/resources/js/nostrApp.js
fsociety 241cc9659f feat: add permission checks for election views
- Add permission checks to the election index and election year views.
- Show election views only to users with a certain association status.
- Update nostrApp.js to entangle the 'isAllowed' state.
2024-09-30 17:09:25 +02:00

17 lines
541 B
JavaScript

export default (livewireComponent) => ({
isAllowed: livewireComponent.entangle('isAllowed', true),
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);
});
},
});