mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 23:29:02 +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";
|
return "x64";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getPlatform(): Platform {
|
export function getPlatform(): Platform | null {
|
||||||
|
if (typeof window === "undefined") return null;
|
||||||
|
|
||||||
const userAgent = navigator.userAgent.toLowerCase();
|
const userAgent = navigator.userAgent.toLowerCase();
|
||||||
if (userAgent.includes('macintosh') || userAgent.includes('mac os x')) {
|
if (userAgent.includes('macintosh') || userAgent.includes('mac os x')) {
|
||||||
return "macos";
|
return "macos";
|
||||||
@ -206,6 +208,7 @@ export function getRecommendedDownload() {
|
|||||||
|
|
||||||
const architecture = getArchitecture();
|
const architecture = getArchitecture();
|
||||||
const platform = getPlatform();
|
const platform = getPlatform();
|
||||||
|
if (!platform) return null;
|
||||||
|
|
||||||
const downloadInfo = downloadMatrix.desktop[platform]?.downloads;
|
const downloadInfo = downloadMatrix.desktop[platform]?.downloads;
|
||||||
const recommendedDownload = Object.entries(downloadInfo || {}).find(d => d[1].recommended);
|
const recommendedDownload = Object.entries(downloadInfo || {}).find(d => d[1].recommended);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user