Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: meeting end not fetching user data #19764

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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