fix: ensure proper redirection and page reload

This commit is contained in:
Adam Shiervani 2025-10-28 18:46:11 +01:00
parent 204909b49a
commit e708ee39f5
1 changed files with 3 additions and 0 deletions

View File

@ -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,10 @@ 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;
await sleep(1000);
window.location.reload();
}
} catch (err) {