From 1b444686af7ff42a010e1b12e78b991815dbf51d Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 28 Sep 2025 00:15:04 +0300 Subject: [PATCH] fix(website): another case of server-side rendering failing --- apps/website/src/download-helper.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/website/src/download-helper.ts b/apps/website/src/download-helper.ts index 95b48a562..2e153f04c 100644 --- a/apps/website/src/download-helper.ts +++ b/apps/website/src/download-helper.ts @@ -190,7 +190,9 @@ export function getArchitecture(): Architecture { return "x64"; } -export function getPlatform(): Platform { +export function getPlatform(): Platform | null { + if (typeof window === "undefined") return null; + const userAgent = navigator.userAgent.toLowerCase(); if (userAgent.includes('macintosh') || userAgent.includes('mac os x')) { return "macos"; @@ -206,6 +208,7 @@ export function getRecommendedDownload() { const architecture = getArchitecture(); const platform = getPlatform(); + if (!platform) return null; const downloadInfo = downloadMatrix.desktop[platform]?.downloads; const recommendedDownload = Object.entries(downloadInfo || {}).find(d => d[1].recommended);