From 42278271654ac2c2762894e8234b0820136e093b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C3=B3n=20Souza?= Date: Thu, 15 Aug 2024 11:58:19 -0300 Subject: [PATCH] fix feedback screen (#20949) --- .../ui/components/meeting-ended/component.tsx | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx b/bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx index 385331472549..b8a307ce2c4c 100644 --- a/bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx +++ b/bigbluebutton-html5/imports/ui/components/meeting-ended/component.tsx @@ -229,7 +229,7 @@ const MeetingEnded: React.FC = ({ 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'); } @@ -319,6 +319,23 @@ const MeetingEnded: React.FC = ({ 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 ( <> @@ -344,23 +361,13 @@ const MeetingEnded: React.FC = ({ ) : null} - {noRating ? ( - setDispatched(true)} - aria-details={intl.formatMessage(intlMessage.confirmDesc)} - > - {intl.formatMessage(intlMessage.buttonOkay)} - - ) : null} - {!noRating ? ( - - {intl.formatMessage(intlMessage.sendLabel)} - - ) : null} + + {buttonLabel} + );