From bdde1987641bda089998e1ffe8a328a7ac0e4858 Mon Sep 17 00:00:00 2001 From: romanetar Date: Mon, 2 Dec 2024 15:02:24 +0100 Subject: [PATCH] fix: extra questions read only conditions --- src/pages/attendees/edit-summit-attendee-page.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/attendees/edit-summit-attendee-page.js b/src/pages/attendees/edit-summit-attendee-page.js index c4c453a7f..f2049662b 100644 --- a/src/pages/attendees/edit-summit-attendee-page.js +++ b/src/pages/attendees/edit-summit-attendee-page.js @@ -49,7 +49,7 @@ class EditSummitAttendeePage extends React.Component { this.setState({ ExtraQuestionsFormReadOnly: false }); this.props.getAttendee(new_attendee_id).then(() => { this.props.getAllowedExtraQuestions(new_attendee_id).then((payload) => { - if (!payload.length) { + if (payload.length === 0) { // we dont have any available extra questions, check if we have some related to // deactivated tickets this.props.getAllowedExtraQuestions(new_attendee_id, false); @@ -72,7 +72,7 @@ class EditSummitAttendeePage extends React.Component { this.setState({ ...this.state, ExtraQuestionsFormReadOnly: false }); this.props.getAttendee(newId).then(() => { this.props.getAllowedExtraQuestions(newId).then((payload) => { - if (!payload?.response?.total) { + if (payload.length === 0) { // we dont have any available extra questions, check if we have some related to // deactivated tickets this.props.getAllowedExtraQuestions(newId, false); @@ -94,7 +94,7 @@ class EditSummitAttendeePage extends React.Component { saveAttendee(entity).then(() => { if (entity.id) { getAllowedExtraQuestions(entity.id).then((payload) => { - if (!payload?.response?.total) { + if (payload.length === 0) { // we dont have any available extra questions, check if we have some related to // deactivated tickets this.props.getAllowedExtraQuestions(entity.id, false);