mirror of
https://github.com/zadam/trilium.git
synced 2025-10-19 22:58:52 +02:00
fix(website): SSR not working due to download helper
This commit is contained in:
parent
093f48f76a
commit
159fab41ce
@ -8,19 +8,19 @@ interface DownloadButtonProps {
|
||||
big?: boolean;
|
||||
}
|
||||
|
||||
const { name, url } = getRecommendedDownload();
|
||||
const recommendedDownload = getRecommendedDownload();
|
||||
|
||||
export default function DownloadButton({ big }: DownloadButtonProps) {
|
||||
return (
|
||||
return (recommendedDownload &&
|
||||
<Button
|
||||
className={`download-button desktop-only ${big ? "big" : ""}`}
|
||||
href={url}
|
||||
href={recommendedDownload.url}
|
||||
iconSvg={downloadIcon}
|
||||
text={<>
|
||||
Download now{" "}
|
||||
{big
|
||||
? <span class="platform">v{packageJson.version} for {name}</span>
|
||||
: <span class="platform">for {name}</span>
|
||||
? <span class="platform">v{packageJson.version} for {recommendedDownload.name}</span>
|
||||
: <span class="platform">for {recommendedDownload.name}</span>
|
||||
}
|
||||
</>}
|
||||
/>
|
||||
|
@ -202,6 +202,8 @@ export function getPlatform(): Platform {
|
||||
}
|
||||
|
||||
export function getRecommendedDownload() {
|
||||
if (typeof window === "undefined") return null;
|
||||
|
||||
const architecture = getArchitecture();
|
||||
const platform = getPlatform();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user