mirror of
https://github.com/zadam/trilium.git
synced 2025-10-21 23:59:02 +02:00
fix(website): yet another case of server-side rendering failing
This commit is contained in:
parent
9274522877
commit
7386bb35e5
@ -181,7 +181,9 @@ export function buildDownloadUrl(app: App, platform: Platform, format: string, a
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getArchitecture(): Architecture {
|
export function getArchitecture(): Architecture | null {
|
||||||
|
if (typeof window === "undefined") return null;
|
||||||
|
|
||||||
const userAgent = navigator.userAgent.toLowerCase();
|
const userAgent = navigator.userAgent.toLowerCase();
|
||||||
if (userAgent.includes('arm64') || userAgent.includes('aarch64')) {
|
if (userAgent.includes('arm64') || userAgent.includes('aarch64')) {
|
||||||
return 'arm64';
|
return 'arm64';
|
||||||
@ -208,7 +210,7 @@ export function getRecommendedDownload() {
|
|||||||
|
|
||||||
const architecture = getArchitecture();
|
const architecture = getArchitecture();
|
||||||
const platform = getPlatform();
|
const platform = getPlatform();
|
||||||
if (!platform) return null;
|
if (!platform || !architecture) 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);
|
||||||
|
@ -10,7 +10,7 @@ import "./get-started.css";
|
|||||||
import packageJson from "../../../../../package.json" with { type: "json" };
|
import packageJson from "../../../../../package.json" with { type: "json" };
|
||||||
|
|
||||||
export default function DownloadPage() {
|
export default function DownloadPage() {
|
||||||
const [ currentArch, setCurrentArch ] = useState(getArchitecture());
|
const [ currentArch, setCurrentArch ] = useState(getArchitecture() ?? "x64");
|
||||||
usePageTitle("Download");
|
usePageTitle("Download");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user