mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	fix(website): SSR not working due to download helper
This commit is contained in:
		| @@ -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(); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user