From 4b6e796a0e6b5c6e97187c0f1d9716966c4ac99c Mon Sep 17 00:00:00 2001 From: Adam Shiervani Date: Wed, 29 Oct 2025 02:04:58 +0100 Subject: [PATCH] fix: ensure proper redirection and page reload (#909) --- ui/src/components/VideoOverlay.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/src/components/VideoOverlay.tsx b/ui/src/components/VideoOverlay.tsx index 10d94108..e84cfc04 100644 --- a/ui/src/components/VideoOverlay.tsx +++ b/ui/src/components/VideoOverlay.tsx @@ -13,6 +13,7 @@ import { useRTCStore, PostRebootAction } from "@/hooks/stores"; import LogoBlue from "@/assets/logo-blue.svg"; import LogoWhite from "@/assets/logo-white.svg"; import { isOnDevice } from "@/main"; +import { sleep } from "@/utils"; interface OverlayContentProps { @@ -481,8 +482,11 @@ export function RebootingOverlay({ show, postRebootAction }: RebootingOverlayPro // - Protocol-relative URLs: resolved with current protocol // - Fully qualified URLs: used as-is const targetUrl = new URL(postRebootAction.redirectTo, window.location.origin); + clearInterval(intervalId); // Stop polling before redirect window.location.href = targetUrl.href; + // Add 1s delay between setting location.href and calling reload() to prevent reload from interrupting the navigation. + await sleep(1000); window.location.reload(); } } catch (err) {