Loading frontend/src/application.tsx +2 −0 Original line number Diff line number Diff line import { routes } from '@generouted/react-router' import Connection from '@inject/graphql/connection' import UrqlClient from '@inject/graphql/urql/client' import { WebsocketDeath } from '@inject/graphql/urql/WebSocketDeath' import PopupEngine from '@inject/shared/popup/PopupEngine' import { RouterProvider, createBrowserRouter } from 'react-router-dom' import DocViewerElement from './classes/DocViewerElement' Loading @@ -14,6 +15,7 @@ const Application = () => { <Connection> <UrqlClient> <PopupEngine> <WebsocketDeath /> <RouterProvider router={router} /> </PopupEngine> </UrqlClient> Loading frontend/src/instructor/InstructorMilestones/AllMilestoneIndicator.tsx +5 −1 Original line number Diff line number Diff line Loading @@ -142,7 +142,11 @@ const AllMilestoneIndicator: FC<MilestoneIndicatorProps> = ({ className={Classes.ALERT} > <div className={Classes.ALERT_BODY}> <Icon icon='warning-sign' size={40} intent={teamIds.length === 0 ? 'danger' : 'warning'} /> <Icon icon='warning-sign' size={40} intent={teamIds.length === 0 ? 'danger' : 'warning'} /> <div className={Classes.ALERT_CONTENTS}> Are you sure you want to mark this milestone as{' '} {reached ? 'not reached' : 'reached'} for Loading frontend/src/users/UserTableSelection/index.tsx +5 −7 Original line number Diff line number Diff line Loading @@ -40,13 +40,11 @@ const UserTableSelection: FC<UserTableSelectionProps> = ({ setSelectedUsers([]) }, [setOpen, setSelectedUsers]) const tableProps = useUserTableSelection( { const tableProps = useUserTableSelection({ groups, selectedUsers, setSelectedUsers, } ) }) return ( <Dialog isOpen={open} onClose={handleCancel} className={maximizedDialog}> Loading graphql/connection/LoginComp.tsx +0 −2 Original line number Diff line number Diff line Loading @@ -65,8 +65,6 @@ const Login = () => { }, }) const res: { sessionid: string } = await req.json() localStorage.clear() sessionStorage.clear() indexedDB.deleteDatabase('graphcache-v3') if (req.status === 403) { throw res as unknown as { status: string; detail: string } Loading graphql/urql/WebSocketDeath.tsx 0 → 100644 +32 −0 Original line number Diff line number Diff line import { logoutUrl } from '@inject/shared/config' import { toaster } from '@inject/shared/notification/toaster' import authenticatedFetch from '@inject/shared/utils/authenticatedFetch' import { useEventListener } from 'ahooks' import { useHost } from '../connection/host' import { sessionid } from '../connection/sessionid' export const WebsocketDeath = () => { const host = useHost() useEventListener('offlineFall', () => { toaster.show({ message: ( <p> App is potentially desynchronized, it's adviced to refresh the application now. (you will be asked to log in again) </p> ), timeout: -1, action: { onClick: () => { window.dispatchEvent(new CustomEvent('killWs')) authenticatedFetch(logoutUrl(host)).then(() => { sessionid('') window.location.reload() }) }, text: 'Refresh', }, }) }) return <></> } Loading
frontend/src/application.tsx +2 −0 Original line number Diff line number Diff line import { routes } from '@generouted/react-router' import Connection from '@inject/graphql/connection' import UrqlClient from '@inject/graphql/urql/client' import { WebsocketDeath } from '@inject/graphql/urql/WebSocketDeath' import PopupEngine from '@inject/shared/popup/PopupEngine' import { RouterProvider, createBrowserRouter } from 'react-router-dom' import DocViewerElement from './classes/DocViewerElement' Loading @@ -14,6 +15,7 @@ const Application = () => { <Connection> <UrqlClient> <PopupEngine> <WebsocketDeath /> <RouterProvider router={router} /> </PopupEngine> </UrqlClient> Loading
frontend/src/instructor/InstructorMilestones/AllMilestoneIndicator.tsx +5 −1 Original line number Diff line number Diff line Loading @@ -142,7 +142,11 @@ const AllMilestoneIndicator: FC<MilestoneIndicatorProps> = ({ className={Classes.ALERT} > <div className={Classes.ALERT_BODY}> <Icon icon='warning-sign' size={40} intent={teamIds.length === 0 ? 'danger' : 'warning'} /> <Icon icon='warning-sign' size={40} intent={teamIds.length === 0 ? 'danger' : 'warning'} /> <div className={Classes.ALERT_CONTENTS}> Are you sure you want to mark this milestone as{' '} {reached ? 'not reached' : 'reached'} for Loading
frontend/src/users/UserTableSelection/index.tsx +5 −7 Original line number Diff line number Diff line Loading @@ -40,13 +40,11 @@ const UserTableSelection: FC<UserTableSelectionProps> = ({ setSelectedUsers([]) }, [setOpen, setSelectedUsers]) const tableProps = useUserTableSelection( { const tableProps = useUserTableSelection({ groups, selectedUsers, setSelectedUsers, } ) }) return ( <Dialog isOpen={open} onClose={handleCancel} className={maximizedDialog}> Loading
graphql/connection/LoginComp.tsx +0 −2 Original line number Diff line number Diff line Loading @@ -65,8 +65,6 @@ const Login = () => { }, }) const res: { sessionid: string } = await req.json() localStorage.clear() sessionStorage.clear() indexedDB.deleteDatabase('graphcache-v3') if (req.status === 403) { throw res as unknown as { status: string; detail: string } Loading
graphql/urql/WebSocketDeath.tsx 0 → 100644 +32 −0 Original line number Diff line number Diff line import { logoutUrl } from '@inject/shared/config' import { toaster } from '@inject/shared/notification/toaster' import authenticatedFetch from '@inject/shared/utils/authenticatedFetch' import { useEventListener } from 'ahooks' import { useHost } from '../connection/host' import { sessionid } from '../connection/sessionid' export const WebsocketDeath = () => { const host = useHost() useEventListener('offlineFall', () => { toaster.show({ message: ( <p> App is potentially desynchronized, it's adviced to refresh the application now. (you will be asked to log in again) </p> ), timeout: -1, action: { onClick: () => { window.dispatchEvent(new CustomEvent('killWs')) authenticatedFetch(logoutUrl(host)).then(() => { sessionid('') window.location.reload() }) }, text: 'Refresh', }, }) }) return <></> }