fix(web): retry startup after the server recovers (#11291)

This commit is contained in:
shivam authored and GitHub committed 2026-09-13 12:56:03 -03:00
1 parent 4a39cade98
commit e628683936
1 file changed
+4 -2
+4 -2
View File
@@ -9,6 +9,7 @@ import {
type ErrorComponentProps,
useLocation,
useNavigate,
useRouter,
} from "@tanstack/react-router";
import { CheckIcon, CopyIcon } from "lucide-react";
import { useEffect, useEffectEvent, useMemo, useRef, useState } from "react";
@@ -353,7 +354,8 @@ function HostedStaticEnvironmentBootstrap() {
return null;
}
function RootRouteErrorView({ error, reset }: ErrorComponentProps) {
function RootRouteErrorView({ error }: ErrorComponentProps) {
const router = useRouter();
const message = errorMessage(error);
// Router pathname rather than window.location: desktop uses hash history, where the window path is always "/".
const pathname = useLocation({ select: (location) => location.pathname });
@@ -376,7 +378,7 @@ function RootRouteErrorView({ error, reset }: ErrorComponentProps) {
<p className="mt-2 text-sm leading-relaxed text-muted-foreground">{message}</p>
<div className="mt-5 flex flex-wrap gap-2">
<Button size="sm" onClick={() => reset()}>
<Button size="sm" onClick={() => void router.invalidate()}>
Try again
</Button>
<Button size="sm" variant="outline" onClick={() => window.location.reload()}>