Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02a6c68079 | ||
|
|
e46e0c02a3 |
Generated
+985
-1127
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -82,7 +82,7 @@
|
||||
"@vitest/browser": "5.0.5",
|
||||
"@vitest/browser-playwright": "5.0.5",
|
||||
"@vitest/coverage-v8": "5.0.5",
|
||||
"@vitest/eslint-plugin": "1.6.28",
|
||||
"@vitest/eslint-plugin": "1.6.27",
|
||||
"@vitest/ui": "5.0.5",
|
||||
"babel-plugin-react-compiler": "1.0.0",
|
||||
"conventional-changelog-conventionalcommits": "10.4.1",
|
||||
|
||||
@@ -10,7 +10,6 @@ import { useAuth } from "@/features/auth";
|
||||
|
||||
type BoundaryProps = PropsWithChildren<{
|
||||
authenticated: boolean;
|
||||
routeKey: string;
|
||||
}>;
|
||||
|
||||
type RouteErrorFallbackProps = {
|
||||
@@ -26,12 +25,6 @@ class Boundary extends Component<BoundaryProps, State> {
|
||||
|
||||
override state: State = { hasError: false };
|
||||
|
||||
override componentDidUpdate(previousProps: BoundaryProps) {
|
||||
if (previousProps.routeKey !== this.props.routeKey && this.state.hasError) {
|
||||
this.setState({ hasError: false });
|
||||
}
|
||||
}
|
||||
|
||||
override render() {
|
||||
return this.state.hasError
|
||||
? <RouteErrorFallback authenticated={this.props.authenticated} />
|
||||
@@ -70,10 +63,7 @@ const RouteErrorBoundary: FC<PropsWithChildren> = (props) => {
|
||||
const { user } = useAuth();
|
||||
|
||||
return (
|
||||
<Boundary
|
||||
authenticated={Boolean(user)}
|
||||
routeKey={`${pathname}${search}:${key}`}
|
||||
>
|
||||
<Boundary authenticated={Boolean(user)} key={`${pathname}${search}:${key}`}>
|
||||
{children}
|
||||
</Boundary>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user