diff --git a/src/components/DefaultCatchBoundary.tsx b/src/components/DefaultCatchBoundary.tsx index 5083603cd..ab80f95ec 100644 --- a/src/components/DefaultCatchBoundary.tsx +++ b/src/components/DefaultCatchBoundary.tsx @@ -9,7 +9,10 @@ import { import * as Sentry from '@sentry/tanstackstart-react' import { Button } from '~/ui' -import { reloadOnStaleAppError } from '~/utils/stale-app-reload' +import { + isStaleAppError, + reloadOnStaleAppError, +} from '~/utils/stale-app-reload' import { useEffect } from 'react' // type DefaultCatchBoundaryType = { @@ -21,6 +24,7 @@ import { useEffect } from 'react' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() + const needsReload = isStaleAppError(error) useEffect(() => { if (reloadOnStaleAppError(error)) return @@ -47,10 +51,14 @@ export function DefaultCatchBoundary({ error }: ErrorComponentProps) { {isRoot ? (