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 {...@@ -9,6 +9,7 @@ import {
9 type ErrorComponentProps,9 type ErrorComponentProps,
10 useLocation,10 useLocation,
11 useNavigate,11 useNavigate,
12 useRouter,
12} from "@tanstack/react-router";13} from "@tanstack/react-router";
13import { CheckIcon, CopyIcon } from "lucide-react";14import { CheckIcon, CopyIcon } from "lucide-react";
14import { useEffect, useEffectEvent, useMemo, useRef, useState } from "react";15import { useEffect, useEffectEvent, useMemo, useRef, useState } from "react";
...@@ -353,7 +354,8 @@ function HostedStaticEnvironmentBootstrap() {...@@ -353,7 +354,8 @@ function HostedStaticEnvironmentBootstrap() {
353 return null;354 return null;
354}355}
355356
356function RootRouteErrorView({ error, reset }: ErrorComponentProps) {357function RootRouteErrorView({ error }: ErrorComponentProps) {
358 const router = useRouter();
357 const message = errorMessage(error);359 const message = errorMessage(error);
358 // Router pathname rather than window.location: desktop uses hash history, where the window path is always "/".360 // Router pathname rather than window.location: desktop uses hash history, where the window path is always "/".
359 const pathname = useLocation({ select: (location) => location.pathname });361 const pathname = useLocation({ select: (location) => location.pathname });
...@@ -376,7 +378,7 @@ function RootRouteErrorView({ error, reset }: ErrorComponentProps) {...@@ -376,7 +378,7 @@ function RootRouteErrorView({ error, reset }: ErrorComponentProps) {
376 <p className="mt-2 text-sm leading-relaxed text-muted-foreground">{message}</p>378 <p className="mt-2 text-sm leading-relaxed text-muted-foreground">{message}</p>
377379
378 <div className="mt-5 flex flex-wrap gap-2">380 <div className="mt-5 flex flex-wrap gap-2">
379 <Button size="sm" onClick={() => reset()}>381 <Button size="sm" onClick={() => void router.invalidate()}>
380 Try again382 Try again
381 </Button>383 </Button>
382 <Button size="sm" variant="outline" onClick={() => window.location.reload()}>384 <Button size="sm" variant="outline" onClick={() => window.location.reload()}>