refactor: Update download.tsx to fix issue with Twilight mode detection
This commit is contained in:
@@ -74,9 +74,7 @@ const FieldDescription = styled.div`
|
|||||||
|
|
||||||
export default function DownloadPage() {
|
export default function DownloadPage() {
|
||||||
const [platform, setPlatform] = useState<string | null>(null);
|
const [platform, setPlatform] = useState<string | null>(null);
|
||||||
if (typeof window === "undefined") return null;
|
const [isTwilight, setIsTwilight] = useState(false);
|
||||||
const searchParams = new URLSearchParams(window.location.search);
|
|
||||||
const [isTwilight, setIsTwilight] = useState(searchParams.has("twilight"));
|
|
||||||
const [architecture, setArchitecture] = useState<string | null>(null);
|
const [architecture, setArchitecture] = useState<string | null>(null);
|
||||||
|
|
||||||
const [selectedPlatform, setSelectedPlatform] = useState("");
|
const [selectedPlatform, setSelectedPlatform] = useState("");
|
||||||
@@ -103,6 +101,8 @@ export default function DownloadPage() {
|
|||||||
if (userAgent.includes("Linux")) {
|
if (userAgent.includes("Linux")) {
|
||||||
setSelectedPlatform("Linux");
|
setSelectedPlatform("Linux");
|
||||||
}
|
}
|
||||||
|
const searchParams = new URLSearchParams(window.location.search);
|
||||||
|
setIsTwilight(searchParams.has("twilight"));
|
||||||
}, []);
|
}, []);
|
||||||
const throwConfetti = () => {
|
const throwConfetti = () => {
|
||||||
const end = Date.now() + 3 * 1000; // 3 seconds
|
const end = Date.now() + 3 * 1000; // 3 seconds
|
||||||
|
|||||||
Reference in New Issue
Block a user