mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
fix(website): another case of server-side rendering failing
This commit is contained in:
parent
b3dfdacdc3
commit
1b444686af
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user