Login starfield: skip painting on a zero-size viewport.

A hidden pane reports 0x0, which made the band direction NaN and
createRadialGradient throw, replacing the login page with the error
boundary. Wait for a resize with a real size instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
oliver 2026-10-14 19:37:31 +08:00
parent e8f77440ca
commit d8da7acb7d

View file

@ -175,6 +175,8 @@ export function LoginStarfield() {
const dpr = Math.min(window.devicePixelRatio || 1, 2);
const w = window.innerWidth;
const h = window.innerHeight;
// Hidden/zero-size viewport: gradients would get NaN coords and throw. Wait for a resize.
if (!(w >= 1 && h >= 1 && Number.isFinite(w) && Number.isFinite(h))) return;
sky.width = Math.round(w * dpr);
sky.height = Math.round(h * dpr);
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);