diff --git a/src/components/download.tsx b/src/components/download.tsx index e63df2b..73ffb87 100644 --- a/src/components/download.tsx +++ b/src/components/download.tsx @@ -74,9 +74,7 @@ const FieldDescription = styled.div` export default function DownloadPage() { const [platform, setPlatform] = useState(null); - if (typeof window === "undefined") return null; - const searchParams = new URLSearchParams(window.location.search); - const [isTwilight, setIsTwilight] = useState(searchParams.has("twilight")); + const [isTwilight, setIsTwilight] = useState(false); const [architecture, setArchitecture] = useState(null); const [selectedPlatform, setSelectedPlatform] = useState(""); @@ -103,6 +101,8 @@ export default function DownloadPage() { if (userAgent.includes("Linux")) { setSelectedPlatform("Linux"); } + const searchParams = new URLSearchParams(window.location.search); + setIsTwilight(searchParams.has("twilight")); }, []); const throwConfetti = () => { const end = Date.now() + 3 * 1000; // 3 seconds