Skip to content

Commit

Permalink
Add ViewErrorBoundary resetKeys prop
Browse files Browse the repository at this point in the history
  • Loading branch information
richardguerre committed Oct 13, 2024
1 parent 7122923 commit 78b486c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/web/src/components/ViewErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { ErrorBoundary } from "@flowdev/error-boundary";
import { Button } from "@flowdev/ui/Button";
import { Link } from "react-router-dom";
import { Link, useLocation } from "react-router-dom";
import { LOCAL_STORAGE_USER_TOKEN_KEY } from "../relay/environment";

type Props = {
children: React.ReactNode;
};

export const ViewErrorBoundary = (props: Props) => {
const location = useLocation();
return (
<ErrorBoundary
resetKeys={[location.pathname]}
fallbackRender={({ error }) => {
const unauthenticatedError = error.cause?.find(
(e: any) => e.extensions?.code === "UNAUTHENTICATED",
Expand Down

0 comments on commit 78b486c

Please sign in to comment.