authorgravatar for 91240327+shivamhwp@users.noreply.github.comshivam <91240327+shivamhwp@users.noreply.github.com> 2026-09-13 21:26:03+05:30
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-13 12:56:03-03:00
loge6286839369a29d829aee3c64dd64ce39c626d2f
tree6c968041ce6f6f4ad3d79311c77e3cda55794049
parent4a39cade982926f607b4606d0f8d92a807f4b0bf
signature Signed by PGP key B5690EEEBB952194

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


1 files changed, 4 insertions(+), 2 deletions(-)

apps/web/src/routes/__root.tsx+4-2
......@@ -9,6 +9,7 @@ import {
99 type ErrorComponentProps,
1010 useLocation,
1111 useNavigate,
12 useRouter,
1213} from "@tanstack/react-router";
1314import { CheckIcon, CopyIcon } from "lucide-react";
1415import { useEffect, useEffectEvent, useMemo, useRef, useState } from "react";
......@@ -353,7 +354,8 @@ function HostedStaticEnvironmentBootstrap() {
353354 return null;
354355}
355356
356function RootRouteErrorView({ error, reset }: ErrorComponentProps) {
357function RootRouteErrorView({ error }: ErrorComponentProps) {
358 const router = useRouter();
357359 const message = errorMessage(error);
358360 // Router pathname rather than window.location: desktop uses hash history, where the window path is always "/".
359361 const pathname = useLocation({ select: (location) => location.pathname });
......@@ -376,7 +378,7 @@ function RootRouteErrorView({ error, reset }: ErrorComponentProps) {
376378 <p className="mt-2 text-sm leading-relaxed text-muted-foreground">{message}</p>
377379
378380 <div className="mt-5 flex flex-wrap gap-2">
379 <Button size="sm" onClick={() => reset()}>
381 <Button size="sm" onClick={() => void router.invalidate()}>
380382 Try again
381383 </Button>
382384 <Button size="sm" variant="outline" onClick={() => window.location.reload()}>