@@ -86,7 +86,6 @@ export default class AppUpdater {
8686 silent : true ,
8787 } ) ;
8888
89- // Only download if no other update is in progress
9089 if ( ! updateInProgress ) {
9190 updateInProgress = true ;
9291 logger . debug ( 'Downloading update - initiating download process...' ) ;
@@ -101,6 +100,8 @@ export default class AppUpdater {
101100 updateInProgress = false ;
102101 logger . error ( 'Error downloading update:' , err ) ;
103102 } ) ;
103+ } else {
104+ logger . debug ( 'Update already in progress, not starting new download.' ) ;
104105 }
105106 } ) ;
106107
@@ -150,13 +151,11 @@ export default class AppUpdater {
150151 return ;
151152 }
152153
153- if ( isAutoUpdateEnabled && getCurrentState ( ) !== State . Offline && ! updateInProgress ) {
154+ if ( isAutoUpdateEnabled && getCurrentState ( ) !== State . Offline ) {
154155 logger . debug ( 'Checking for updates.' ) ;
155156 autoUpdater . checkForUpdates ( ) . catch ( ( err ) => {
156157 logger . error ( 'Error checking for updates:' , err ) ;
157158 } ) ;
158- } else if ( updateInProgress ) {
159- logger . debug ( 'Update already in progress, skipping check.' ) ;
160159 } else {
161160 logger . debug ( 'Auto update disabled.' ) ;
162161 }
@@ -188,7 +187,6 @@ export default class AppUpdater {
188187 showNotification ( { body : `Checking for updates...` , silent : true } ) ;
189188
190189 try {
191- updateInProgress = true ;
192190 const result : UpdateCheckResult | null = await autoUpdater . checkForUpdates ( ) ;
193191
194192 if ( result ?. updateInfo ?. version ) {
@@ -197,7 +195,6 @@ export default class AppUpdater {
197195 const currentVersionString = app . getVersion ( ) ;
198196
199197 if ( currentVersionString === latestVersion ) {
200- updateInProgress = false ;
201198 showNotification ( {
202199 body : `Up to date! You have version ${ currentVersionString } ` ,
203200 silent : true ,
@@ -206,7 +203,6 @@ export default class AppUpdater {
206203 // If there's an update, the update-available event will handle it
207204 }
208205 } catch ( e ) {
209- updateInProgress = false ;
210206 logger . error ( 'Error checking updates' , e ) ;
211207 showNotification ( {
212208 title : 'Tockler error' ,
0 commit comments