Fix: meeting end not fetching user data
This commit is contained in:
parent
9abc02e559
commit
7bdb48d100
@ -184,10 +184,11 @@ select_permissions:
|
|||||||
- endedBy
|
- endedBy
|
||||||
- endedByUserName
|
- endedByUserName
|
||||||
- endedReasonCode
|
- endedReasonCode
|
||||||
|
- isBreakout
|
||||||
- logoutUrl
|
- logoutUrl
|
||||||
- meetingId
|
- meetingId
|
||||||
- name
|
- name
|
||||||
filter:
|
filter:
|
||||||
meetingId:
|
meetingId:
|
||||||
_eq: X-Hasura-MeetingId
|
_eq: X-Hasura-MeetingId
|
||||||
comment: ""
|
comment: ""
|
||||||
|
@ -171,7 +171,7 @@ interface MeetingEndedProps extends MeetingEndedContainerProps {
|
|||||||
allowDefaultLogoutUrl: boolean;
|
allowDefaultLogoutUrl: boolean;
|
||||||
askForFeedbackOnLogout: boolean
|
askForFeedbackOnLogout: boolean
|
||||||
learningDashboardAccessToken: string;
|
learningDashboardAccessToken: string;
|
||||||
role: string;
|
isModerator: boolean;
|
||||||
learningDashboardBase: string;
|
learningDashboardBase: string;
|
||||||
isBreakout: boolean;
|
isBreakout: boolean;
|
||||||
}
|
}
|
||||||
@ -183,7 +183,7 @@ const MeetingEnded: React.FC<MeetingEndedProps> = ({
|
|||||||
allowDefaultLogoutUrl,
|
allowDefaultLogoutUrl,
|
||||||
askForFeedbackOnLogout,
|
askForFeedbackOnLogout,
|
||||||
learningDashboardAccessToken,
|
learningDashboardAccessToken,
|
||||||
role,
|
isModerator,
|
||||||
learningDashboardBase,
|
learningDashboardBase,
|
||||||
isBreakout,
|
isBreakout,
|
||||||
}) => {
|
}) => {
|
||||||
@ -220,7 +220,7 @@ const MeetingEnded: React.FC<MeetingEndedProps> = ({
|
|||||||
authToken,
|
authToken,
|
||||||
meetingId,
|
meetingId,
|
||||||
comment,
|
comment,
|
||||||
userRole: role,
|
isModerator,
|
||||||
};
|
};
|
||||||
const url = './feedback';
|
const url = './feedback';
|
||||||
const options = {
|
const options = {
|
||||||
@ -233,7 +233,7 @@ const MeetingEnded: React.FC<MeetingEndedProps> = ({
|
|||||||
setDispatched(true);
|
setDispatched(true);
|
||||||
|
|
||||||
fetch(url, options).then(() => {
|
fetch(url, options).then(() => {
|
||||||
if (role === 'VIEWER') {
|
if (!isModerator) {
|
||||||
const REDIRECT_WAIT_TIME = 5000;
|
const REDIRECT_WAIT_TIME = 5000;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.href = logoutUrl;
|
window.location.href = logoutUrl;
|
||||||
@ -263,7 +263,7 @@ const MeetingEnded: React.FC<MeetingEndedProps> = ({
|
|||||||
(
|
(
|
||||||
<Styled.Wrapper>
|
<Styled.Wrapper>
|
||||||
{
|
{
|
||||||
learningDashboardAccessToken && role === 'moderator'
|
learningDashboardAccessToken && isModerator
|
||||||
// Always set cookie in case Dashboard is already opened
|
// Always set cookie in case Dashboard is already opened
|
||||||
&& setLearningDashboardCookie(learningDashboardAccessToken, meetingId) === true
|
&& setLearningDashboardCookie(learningDashboardAccessToken, meetingId) === true
|
||||||
? (
|
? (
|
||||||
@ -298,7 +298,7 @@ const MeetingEnded: React.FC<MeetingEndedProps> = ({
|
|||||||
</Styled.Wrapper>
|
</Styled.Wrapper>
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}, [learningDashboardAccessToken, role, meetingId, authToken, learningDashboardBase]);
|
}, [learningDashboardAccessToken, isModerator, meetingId, authToken, learningDashboardBase]);
|
||||||
|
|
||||||
const feedbackScreen = useMemo(() => {
|
const feedbackScreen = useMemo(() => {
|
||||||
const shouldShowFeedback = askForFeedbackOnLogout && !dispatched;
|
const shouldShowFeedback = askForFeedbackOnLogout && !dispatched;
|
||||||
@ -387,8 +387,7 @@ const MeetingEndedContainer: React.FC<MeetingEndedContainerProps> = ({
|
|||||||
allowDefaultLogoutUrl={false}
|
allowDefaultLogoutUrl={false}
|
||||||
askForFeedbackOnLogout={false}
|
askForFeedbackOnLogout={false}
|
||||||
learningDashboardAccessToken=""
|
learningDashboardAccessToken=""
|
||||||
// eslint-disable-next-line jsx-a11y/aria-role
|
isModerator={false}
|
||||||
role=""
|
|
||||||
learningDashboardBase=""
|
learningDashboardBase=""
|
||||||
isBreakout={false}
|
isBreakout={false}
|
||||||
/>
|
/>
|
||||||
@ -405,8 +404,7 @@ const MeetingEndedContainer: React.FC<MeetingEndedContainerProps> = ({
|
|||||||
allowDefaultLogoutUrl={false}
|
allowDefaultLogoutUrl={false}
|
||||||
askForFeedbackOnLogout={false}
|
askForFeedbackOnLogout={false}
|
||||||
learningDashboardAccessToken=""
|
learningDashboardAccessToken=""
|
||||||
// eslint-disable-next-line jsx-a11y/aria-role
|
isModerator={false}
|
||||||
role=""
|
|
||||||
learningDashboardBase=""
|
learningDashboardBase=""
|
||||||
isBreakout={false}
|
isBreakout={false}
|
||||||
/>
|
/>
|
||||||
@ -417,7 +415,7 @@ const MeetingEndedContainer: React.FC<MeetingEndedContainerProps> = ({
|
|||||||
user_current,
|
user_current,
|
||||||
} = meetingEndData;
|
} = meetingEndData;
|
||||||
const {
|
const {
|
||||||
role,
|
isModerator,
|
||||||
meeting,
|
meeting,
|
||||||
} = user_current[0];
|
} = user_current[0];
|
||||||
|
|
||||||
@ -441,7 +439,7 @@ const MeetingEndedContainer: React.FC<MeetingEndedContainerProps> = ({
|
|||||||
allowDefaultLogoutUrl={allowDefaultLogoutUrl}
|
allowDefaultLogoutUrl={allowDefaultLogoutUrl}
|
||||||
askForFeedbackOnLogout={askForFeedbackOnLogout}
|
askForFeedbackOnLogout={askForFeedbackOnLogout}
|
||||||
learningDashboardAccessToken={learningDashboard?.learningDashboardAccessToken}
|
learningDashboardAccessToken={learningDashboard?.learningDashboardAccessToken}
|
||||||
role={role}
|
isModerator={isModerator}
|
||||||
learningDashboardBase={learningDashboardBase}
|
learningDashboardBase={learningDashboardBase}
|
||||||
isBreakout={isBreakout}
|
isBreakout={isBreakout}
|
||||||
/>
|
/>
|
||||||
|
@ -2,7 +2,7 @@ import { gql } from '@apollo/client';
|
|||||||
|
|
||||||
export interface MeetingEndDataResponse {
|
export interface MeetingEndDataResponse {
|
||||||
user_current: Array<{
|
user_current: Array<{
|
||||||
role: string;
|
isModerator: boolean;
|
||||||
meeting: {
|
meeting: {
|
||||||
learningDashboard: {
|
learningDashboard: {
|
||||||
learningDashboardAccessToken: string;
|
learningDashboardAccessToken: string;
|
||||||
@ -21,7 +21,7 @@ export interface MeetingEndDataResponse {
|
|||||||
export const getMeetingEndData = gql`
|
export const getMeetingEndData = gql`
|
||||||
query getMeetingEndData {
|
query getMeetingEndData {
|
||||||
user_current {
|
user_current {
|
||||||
role
|
isModerator
|
||||||
meeting {
|
meeting {
|
||||||
learningDashboard {
|
learningDashboard {
|
||||||
learningDashboardAccessToken
|
learningDashboardAccessToken
|
||||||
|
Loading…
Reference in New Issue
Block a user