@@ -228,48 +228,45 @@ app.on('ready', function appReady () {
228228 } )
229229 } )
230230
231- setTimeout ( ( ) => {
232- autoUpdater . checkForUpdatesAndNotify ( )
233- } , 500 )
234-
235231 if ( process . platform !== 'darwin' ) { // TODO System tray on windows (maybe linux)
236232 // since window-all-closed doesn't fire with our hidden audio process
237233 player . win . once ( 'closed' , ( ) => {
238234 app . quit ( )
239235 } )
240236 }
241- } )
242237
243- autoUpdater . on ( 'error' , ( err ) => {
244- console . log ( err )
245- } )
238+ setTimeout ( ( ) => {
239+ autoUpdater . checkForUpdatesAndNotify ( )
240+ } , 500 )
246241
247- autoUpdater . on ( 'checking-for-update' , ( ) => {
248- console . log ( 'autoUpdater: Checking for update...' )
249- } )
242+ autoUpdater . on ( 'error' , ( err ) => {
243+ console . log ( err )
244+ broadcast ( 'au:error' , err )
245+ } )
250246
251- autoUpdater . on ( 'update-available ' , ( info ) => {
252- console . log ( ` autoUpdater: Update available!` )
253- console . log ( info )
254- } )
247+ autoUpdater . on ( 'checking-for-update ' , ( ) => {
248+ console . log ( ' autoUpdater: Checking for update...' )
249+ broadcast ( 'au:checking-for-update' )
250+ } )
255251
256- autoUpdater . on ( 'update-not -available' , ( info ) => {
257- console . log ( `autoUpdater: No update available` )
258- console . log ( info )
259- } )
252+ autoUpdater . on ( 'update-available' , ( info ) => {
253+ console . log ( `autoUpdater: Update available! ` )
254+ broadcast ( 'au:update-available' , info )
255+ } )
260256
261- autoUpdater . on ( 'update-not-available' , ( info ) => {
262- console . log ( `autoUpdater: No update available` )
263- console . log ( info )
264- } )
257+ autoUpdater . on ( 'update-not-available' , ( info ) => {
258+ console . log ( `autoUpdater: No update available` )
259+ broadcast ( 'au:update-not-available' , info )
260+ } )
265261
266- autoUpdater . on ( 'download-progress' , ( progress ) => {
267- console . log ( progress )
268- } )
262+ autoUpdater . on ( 'download-progress' , ( progress ) => {
263+ broadcast ( 'au:progress' , progress )
264+ } )
269265
270- autoUpdater . on ( 'update-downloaded' , ( info ) => {
271- console . log ( `autoUpdater: Update downloaded` )
272- console . log ( info )
266+ autoUpdater . on ( 'update-downloaded' , ( info ) => {
267+ console . log ( `autoUpdater: Update downloaded` )
268+ broadcast ( 'au:update-downloaded' , info )
269+ } )
273270} )
274271
275272app . on ( 'activate' , function activate ( ) {
0 commit comments