@@ -22,6 +22,7 @@ export default class AppUpdater {
2222 private readonly menubar : Menubar ;
2323 private readonly menuBuilder : MenuBuilder ;
2424 private started = false ;
25+ private noUpdateMessageTimeout ?: NodeJS . Timeout ;
2526
2627 constructor ( menubar : Menubar , menuBuilder : MenuBuilder ) {
2728 this . menubar = menubar ;
@@ -56,6 +57,9 @@ export default class AppUpdater {
5657 logInfo ( 'auto updater' , 'Checking for update' ) ;
5758 this . menuBuilder . setCheckForUpdatesMenuEnabled ( false ) ;
5859 this . menuBuilder . setNoUpdateAvailableMenuVisibility ( false ) ;
60+
61+ // Clear any existing timeout when starting a new check
62+ this . clearNoUpdateTimeout ( ) ;
5963 } ) ;
6064
6165 autoUpdater . on ( 'update-available' , ( ) => {
@@ -84,6 +88,12 @@ export default class AppUpdater {
8488 this . menuBuilder . setNoUpdateAvailableMenuVisibility ( true ) ;
8589 this . menuBuilder . setUpdateAvailableMenuVisibility ( false ) ;
8690 this . menuBuilder . setUpdateReadyForInstallMenuVisibility ( false ) ;
91+
92+ // Auto-hide the "no updates available" message
93+ this . clearNoUpdateTimeout ( ) ;
94+ this . noUpdateMessageTimeout = setTimeout ( ( ) => {
95+ this . menuBuilder . setNoUpdateAvailableMenuVisibility ( false ) ;
96+ } , APPLICATION . UPDATE_NOT_AVAILABLE_DISPLAY_MS ) ;
8797 } ) ;
8898
8999 autoUpdater . on ( 'update-cancelled' , ( ) => {
@@ -121,12 +131,22 @@ export default class AppUpdater {
121131 this . menubar . tray . setToolTip ( `${ APPLICATION . NAME } \n${ status } ` ) ;
122132 }
123133
134+ private clearNoUpdateTimeout ( ) {
135+ if ( this . noUpdateMessageTimeout ) {
136+ clearTimeout ( this . noUpdateMessageTimeout ) ;
137+ this . noUpdateMessageTimeout = undefined ;
138+ }
139+ }
140+
124141 private resetState ( ) {
125142 this . menubar . tray . setToolTip ( APPLICATION . NAME ) ;
126143 this . menuBuilder . setCheckForUpdatesMenuEnabled ( true ) ;
127144 this . menuBuilder . setNoUpdateAvailableMenuVisibility ( false ) ;
128145 this . menuBuilder . setUpdateAvailableMenuVisibility ( false ) ;
129146 this . menuBuilder . setUpdateReadyForInstallMenuVisibility ( false ) ;
147+
148+ // Clear any pending timeout
149+ this . clearNoUpdateTimeout ( ) ;
130150 }
131151
132152 private showUpdateReadyDialog ( releaseName : string ) {
0 commit comments