@@ -26,7 +26,7 @@ export default function GlobalMenu({ isHorizontalLayout }: { isHorizontalLayout:
2626 const isVerticalLayout = ! isHorizontalLayout ;
2727 const parentComponent = useContext ( ParentComponent ) ;
2828 const { isUpdateAvailable, latestVersion } = useTriliumUpdateStatus ( ) ;
29-
29+
3030 return (
3131 < Dropdown
3232 className = "global-menu"
@@ -58,14 +58,14 @@ export default function GlobalMenu({ isHorizontalLayout }: { isHorizontalLayout:
5858 < KeyboardActionMenuItem command = "showHelp" icon = "bx bx-help-circle" text = { t ( "global_menu.show_help" ) } />
5959 < KeyboardActionMenuItem command = "showCheatsheet" icon = "bx bxs-keyboard" text = { t ( "global_menu.show-cheatsheet" ) } />
6060 < MenuItem command = "openAboutDialog" icon = "bx bx-info-circle" text = { t ( "global_menu.about" ) } />
61-
61+
6262 { isUpdateAvailable && < >
6363 < FormListHeader text = { t ( "global_menu.new-version-available" ) } />
6464 < MenuItem command = { ( ) => window . open ( "https://github.com/TriliumNext/Trilium/releases/latest" ) }
6565 icon = "bx bx-download"
6666 text = { t ( "global_menu.download-update" , { latestVersion} ) } />
6767 </ > }
68-
68+
6969 { ! isElectron ( ) && < BrowserOnlyOptions /> }
7070 </ Dropdown >
7171 )
@@ -221,9 +221,15 @@ function useTriliumUpdateStatus() {
221221 async function updateVersionStatus ( ) {
222222 const RELEASES_API_URL = "https://api.github.com/repos/TriliumNext/Trilium/releases/latest" ;
223223
224- const resp = await fetch ( RELEASES_API_URL ) ;
225- const data = await resp . json ( ) ;
226- const latestVersion = data ?. tag_name ?. substring ( 1 ) ;
224+ let latestVersion : string | undefined = undefined ;
225+ try {
226+ const resp = await fetch ( RELEASES_API_URL ) ;
227+ const data = await resp . json ( ) ;
228+ latestVersion = data ?. tag_name ?. substring ( 1 ) ;
229+ } catch ( e ) {
230+ console . warn ( "Unable to fetch latest version info from GitHub releases API" , e ) ;
231+ }
232+
227233 setLatestVersion ( latestVersion ) ;
228234 }
229235
0 commit comments