@@ -4,9 +4,9 @@ export type App = "desktop" | "server";
44
55export type Architecture = 'x64' | 'arm64' ;
66
7- export type Platform = ' macos' | ' windows' | ' linux' ;
7+ export type Platform = " macos" | " windows" | " linux" | "pikapod" ;
88
9- let version = rootPackageJson . version ;
9+ const version = rootPackageJson . version ;
1010
1111export interface DownloadInfo {
1212 recommended ?: boolean ;
@@ -20,7 +20,7 @@ export interface DownloadMatrixEntry {
2020 downloads : Record < string , DownloadInfo > ;
2121}
2222
23- type DownloadMatrix = Record < App , Record < Platform , DownloadMatrixEntry > > ;
23+ type DownloadMatrix = Record < App , { [ P in Platform ] ?: DownloadMatrixEntry } > ;
2424
2525// Keep compatibility info inline with https://github.com/electron/electron/blob/main/README.md#platform-support.
2626export const downloadMatrix : DownloadMatrix = {
@@ -131,7 +131,7 @@ export function buildDownloadUrl(app: App, platform: Platform, format: string, a
131131 if ( app === "desktop" ) {
132132 return `https://github.com/TriliumNext/Notes/releases/download/v${ version } /TriliumNextNotes-v${ version } -${ platform } -${ architecture } .${ format } ` ;
133133 } else if ( app === "server" ) {
134- return downloadMatrix . server [ platform ] . downloads [ format ] . url ?? "#" ;
134+ return downloadMatrix . server [ platform ] ? .downloads [ format ] . url ?? "#" ;
135135 } else {
136136 return "#" ;
137137 }
@@ -149,7 +149,7 @@ export function getArchitecture(): Architecture {
149149function getPlatform ( ) : Platform {
150150 const userAgent = navigator . userAgent . toLowerCase ( ) ;
151151 if ( userAgent . includes ( 'macintosh' ) || userAgent . includes ( 'mac os x' ) ) {
152- return "mac " ;
152+ return "macos " ;
153153 } else if ( userAgent . includes ( 'windows' ) || userAgent . includes ( 'win32' ) ) {
154154 return "windows" ;
155155 } else {
0 commit comments