1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-24 23:01:05 +03:00

Error boundary (#1743)

* reinstate link to browser session detail

* add util hook for unwrapping current browser session id

* fix bug in compatsessiondetail createdAt -> finishedAt

* browser session detail page

* tweak naming

* add ErrorBoundary

* useCurrentBrowserSessionId throw when error

* add ErrorBoundary to pages

* throw errors instead of rendering error

* add unwrap util
This commit is contained in:
Kerry
2023-09-14 12:26:32 +12:00
committed by GitHub
parent 11ea6660c8
commit ce2395f94b
16 changed files with 154 additions and 48 deletions

View File

@@ -16,6 +16,7 @@ import { useAtomValue } from "jotai";
import { atomWithQuery } from "jotai-urql";
import { mapQueryAtom } from "../atoms";
import ErrorBoundary from "../components/ErrorBoundary";
import GraphQLError from "../components/GraphQLError";
import NotLoggedIn from "../components/NotLoggedIn";
import UserSessionsOverview from "../components/UserSessionsOverview";
@@ -54,7 +55,11 @@ const SessionsOverview: React.FC = () => {
const data = unwrapOk(result);
if (data === null) return <NotLoggedIn />;
return <UserSessionsOverview user={data} />;
return (
<ErrorBoundary>
<UserSessionsOverview user={data} />
</ErrorBoundary>
);
};
export default SessionsOverview;