diff --git a/includes/core/classes/blocks/class-rsvp.php b/includes/core/classes/blocks/class-rsvp.php index 045f3122e..ab9d090e9 100644 --- a/includes/core/classes/blocks/class-rsvp.php +++ b/includes/core/classes/blocks/class-rsvp.php @@ -123,7 +123,7 @@ public function transform_block_content( string $block_content, array $block ): $button_tag = $block_instance->locate_button_tag( $tag ); if ( $button_tag ) { $button_tag->set_attribute( 'data-wp-interactive', 'gatherpress' ); - $button_tag->set_attribute( 'data-wp-on--click', 'actions.rsvpChangeStatus' ); + $button_tag->set_attribute( 'data-wp-on--click', 'actions.updateRsvp' ); } // Update the block content with new attributes. diff --git a/src/blocks/rsvp-v2/view.js b/src/blocks/rsvp-v2/view.js index e56e2c09d..cdd49e44c 100644 --- a/src/blocks/rsvp-v2/view.js +++ b/src/blocks/rsvp-v2/view.js @@ -10,21 +10,7 @@ import { getFromGlobal } from '../../helpers/globals'; const { state, actions } = store('gatherpress', { actions: { - rsvpOpenModal() { - const modal = document.querySelector('.gatherpress-rsvp-modal'); - - if (modal) { - modal.classList.add('gatherpress--is-visible'); - } - }, - rsvpCloseModal() { - const modal = document.querySelector('.gatherpress-rsvp-modal'); - - if (modal) { - modal.classList.remove('gatherpress--is-visible'); - } - }, - rsvpChangeStatus() { + updateRsvp() { let status = state.rsvpStatus ?? getFromGlobal('eventDetails.currentUser.status') ??