Skip to content

Commit

Permalink
fix feedback screen (bigbluebutton#20949)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonlsouza authored Aug 15, 2024
1 parent a704c58 commit 4227827
Showing 1 changed file with 25 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ const MeetingEnded: React.FC<MeetingEndedProps> = ({
isModerator,
};

const pathMatch = window.location.pathname.match('^(.*)/html5client/join$');
const pathMatch = window.location.pathname.match('^(.*)/html5client/$');
if (pathMatch == null) {
throw new Error('Failed to match BBB client URI');
}
Expand Down Expand Up @@ -319,6 +319,23 @@ const MeetingEnded: React.FC<MeetingEndedProps> = ({
const feedbackScreen = useMemo(() => {
const shouldShowFeedback = askForFeedbackOnLogout && !dispatched;
const noRating = selectedStars === 0;

let buttonAction = () => confirmRedirect(isBreakout, allowDefaultLogoutUrl);
let buttonDesc = intl.formatMessage(intlMessage.confirmDesc);
let buttonLabel = intl.formatMessage(intlMessage.buttonOkay);

if (!dispatched) {
if (noRating) {
buttonAction = () => setDispatched(true);
buttonDesc = intl.formatMessage(intlMessage.confirmDesc);
buttonLabel = intl.formatMessage(intlMessage.buttonOkay);
} else {
buttonAction = () => sendFeedback();
buttonDesc = intl.formatMessage(intlMessage.sendDesc);
buttonLabel = intl.formatMessage(intlMessage.sendLabel);
}
}

return (
<>
<Styled.Text>
Expand All @@ -344,23 +361,13 @@ const MeetingEnded: React.FC<MeetingEndedProps> = ({
</div>
) : null}
<Styled.Wrapper>
{noRating ? (
<Styled.MeetingEndedButton
color="primary"
onClick={() => setDispatched(true)}
aria-details={intl.formatMessage(intlMessage.confirmDesc)}
>
{intl.formatMessage(intlMessage.buttonOkay)}
</Styled.MeetingEndedButton>
) : null}
{!noRating ? (
<Styled.MeetingEndedButton
onClick={sendFeedback}
aria-details={intl.formatMessage(intlMessage.sendDesc)}
>
{intl.formatMessage(intlMessage.sendLabel)}
</Styled.MeetingEndedButton>
) : null}
<Styled.MeetingEndedButton
color="primary"
onClick={buttonAction}
aria-details={buttonDesc}
>
{buttonLabel}
</Styled.MeetingEndedButton>
</Styled.Wrapper>
</>
);
Expand Down

0 comments on commit 4227827

Please sign in to comment.