Skip to content

Commit

Permalink
[DX-Adoption] [RSVP Configs] Better handling of change of cloudType a…
Browse files Browse the repository at this point in the history
…nd eventType (#365)

* Better re-render logic

* remove redundant condition
  • Loading branch information
qiyundai authored Feb 12, 2025
1 parent d5345e6 commit b44c024
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions ecc/blocks/registration-details-component/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ function updateHeadingTooltip(component) {

export async function onPayloadUpdate(component, props) {
const { cloudType, eventType } = props.payload;
if (eventType && eventType !== component.dataset.eventType) {
component.dataset.eventType = eventType;
}
const eventTypeChange = eventType && eventType !== component.dataset.eventType;
const cloudTypeChange = cloudType && cloudType !== component.dataset.cloudType;

if (cloudType && cloudType !== component.dataset.cloudType) {
component.dataset.cloudType = cloudType;
if (eventTypeChange) component.dataset.eventType = eventType;
if (eventTypeChange) component.dataset.cloudType = cloudType;
if (cloudTypeChange || eventTypeChange) {
const registrationConfigsWrapper = component.querySelector('.registration-configs-wrapper');

if (!registrationConfigsWrapper) return;
Expand All @@ -252,19 +252,6 @@ export async function onPayloadUpdate(component, props) {
}

updateHeadingTooltip(component);
} else if (eventType && eventType !== component.dataset.eventType) {
if (cloudType === 'ExperienceCloud') {
switch (eventType) {
case 'InPerson':
buildExperienceCloudInPersonFields(component);
break;
case 'Webinar':
buildExperienceCloudWebinarFields(component);
break;
default:
break;
}
}
}
}

Expand Down

0 comments on commit b44c024

Please sign in to comment.