Skip to content

Commit

Permalink
Update content-update.js
Browse files Browse the repository at this point in the history
  • Loading branch information
qiyundai committed Oct 11, 2024
1 parent 1f434b4 commit 8219dcd
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions events/scripts/content-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,8 @@ function createTag(tag, attributes, html, options = {}) {
async function updateRSVPButtonState(rsvpBtn, miloLibs, eventInfo) {
const rsvpData = BlockMediator.get('rsvpData');
const checkRed = getIcon('check-circle-red');
const {
attendeeLimit,
attendeeCount,
allowWaitListing,
} = eventInfo;
const eventFull = +attendeeLimit <= +attendeeCount;
let eventFull = false;
if (eventInfo) eventFull = +eventInfo.attendeeLimit <= +eventInfo.attendeeCount;

const enableBtn = () => {
rsvpBtn.el.classList.remove('disabled');
Expand Down Expand Up @@ -152,7 +148,7 @@ async function updateRSVPButtonState(rsvpBtn, miloLibs, eventInfo) {

if (!rsvpData) {
if (eventFull) {
if (allowWaitListing) {
if (eventInfo?.allowWaitListing) {
await waitlistState();
} else {
await closedState();
Expand Down

0 comments on commit 8219dcd

Please sign in to comment.