Skip to content

Commit

Permalink
Merge pull request #19764 from Tainan404/fix-meeting-end
Browse files Browse the repository at this point in the history
Fix: meeting end not fetching user data
  • Loading branch information
ramonlsouza committed Mar 12, 2024
2 parents f76731f + 7bdb48d commit 9cd1b21
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,11 @@ select_permissions:
- endedBy
- endedByUserName
- endedReasonCode
- isBreakout
- logoutUrl
- meetingId
- name
filter:
meetingId:
_eq: X-Hasura-MeetingId
comment: ""
comment: ""
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ interface MeetingEndedProps extends MeetingEndedContainerProps {
allowDefaultLogoutUrl: boolean;
askForFeedbackOnLogout: boolean
learningDashboardAccessToken: string;
role: string;
isModerator: boolean;
learningDashboardBase: string;
isBreakout: boolean;
}
Expand All @@ -183,7 +183,7 @@ const MeetingEnded: React.FC<MeetingEndedProps> = ({
allowDefaultLogoutUrl,
askForFeedbackOnLogout,
learningDashboardAccessToken,
role,
isModerator,
learningDashboardBase,
isBreakout,
}) => {
Expand Down Expand Up @@ -220,7 +220,7 @@ const MeetingEnded: React.FC<MeetingEndedProps> = ({
authToken,
meetingId,
comment,
userRole: role,
isModerator,
};
const url = './feedback';
const options = {
Expand All @@ -233,7 +233,7 @@ const MeetingEnded: React.FC<MeetingEndedProps> = ({
setDispatched(true);

fetch(url, options).then(() => {
if (role === 'VIEWER') {
if (!isModerator) {
const REDIRECT_WAIT_TIME = 5000;
setTimeout(() => {
window.location.href = logoutUrl;
Expand Down Expand Up @@ -263,7 +263,7 @@ const MeetingEnded: React.FC<MeetingEndedProps> = ({
(
<Styled.Wrapper>
{
learningDashboardAccessToken && role === 'moderator'
learningDashboardAccessToken && isModerator
// Always set cookie in case Dashboard is already opened
&& setLearningDashboardCookie(learningDashboardAccessToken, meetingId) === true
? (
Expand Down Expand Up @@ -298,7 +298,7 @@ const MeetingEnded: React.FC<MeetingEndedProps> = ({
</Styled.Wrapper>
)
);
}, [learningDashboardAccessToken, role, meetingId, authToken, learningDashboardBase]);
}, [learningDashboardAccessToken, isModerator, meetingId, authToken, learningDashboardBase]);

const feedbackScreen = useMemo(() => {
const shouldShowFeedback = askForFeedbackOnLogout && !dispatched;
Expand Down Expand Up @@ -387,8 +387,7 @@ const MeetingEndedContainer: React.FC<MeetingEndedContainerProps> = ({
allowDefaultLogoutUrl={false}
askForFeedbackOnLogout={false}
learningDashboardAccessToken=""
// eslint-disable-next-line jsx-a11y/aria-role
role=""
isModerator={false}
learningDashboardBase=""
isBreakout={false}
/>
Expand All @@ -405,8 +404,7 @@ const MeetingEndedContainer: React.FC<MeetingEndedContainerProps> = ({
allowDefaultLogoutUrl={false}
askForFeedbackOnLogout={false}
learningDashboardAccessToken=""
// eslint-disable-next-line jsx-a11y/aria-role
role=""
isModerator={false}
learningDashboardBase=""
isBreakout={false}
/>
Expand All @@ -417,7 +415,7 @@ const MeetingEndedContainer: React.FC<MeetingEndedContainerProps> = ({
user_current,
} = meetingEndData;
const {
role,
isModerator,
meeting,
} = user_current[0];

Expand All @@ -441,7 +439,7 @@ const MeetingEndedContainer: React.FC<MeetingEndedContainerProps> = ({
allowDefaultLogoutUrl={allowDefaultLogoutUrl}
askForFeedbackOnLogout={askForFeedbackOnLogout}
learningDashboardAccessToken={learningDashboard?.learningDashboardAccessToken}
role={role}
isModerator={isModerator}
learningDashboardBase={learningDashboardBase}
isBreakout={isBreakout}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { gql } from '@apollo/client';

export interface MeetingEndDataResponse {
user_current: Array<{
role: string;
isModerator: boolean;
meeting: {
learningDashboard: {
learningDashboardAccessToken: string;
Expand All @@ -21,7 +21,7 @@ export interface MeetingEndDataResponse {
export const getMeetingEndData = gql`
query getMeetingEndData {
user_current {
role
isModerator
meeting {
learningDashboard {
learningDashboardAccessToken
Expand Down

0 comments on commit 9cd1b21

Please sign in to comment.