@@ -22,34 +22,40 @@ var appQuit = false
2222var version = app . getVersion ( )
2323var versionText = ( version == null || version . length === 0 ) ? 'DEV version' : 'v' + version
2424var versionNotified = false
25+
26+ function notify ( title , body ) {
27+ if ( mainWindow != null ) {
28+ mainWindow . webContents . send ( 'notify' , {
29+ title : title ,
30+ body : body
31+ } )
32+ }
33+ }
34+
2535autoUpdater
2636 . on ( 'update-downloaded' , function ( event , releaseNotes , releaseName , releaseDate , updateUrl , quitAndUpdate ) {
2737 update = quitAndUpdate
2838
2939 if ( mainWindow != null ) {
30- mainWindow . webContents . send ( ' notify' , 'Ready to Update! ' + releaseName , 'Click update button on Main window.' )
40+ notify ( 'Ready to Update! ' + releaseName , 'Click update button on Main window.' )
3141 mainWindow . webContents . send ( 'update-available' , 'Update available!' )
3242 }
3343 } )
3444 . on ( 'error' , function ( err , message ) {
3545 console . error ( err )
36- if ( mainWindow != null && ! versionNotified ) {
37- mainWindow . webContents . send ( 'notify' , 'Updater error!' , message )
38- }
46+ notify ( 'Updater error!' , message )
3947 } )
4048 // .on('checking-for-update', function () {
4149 // // Connecting
4250 // console.log('checking...')
4351 // })
4452 . on ( 'update-available' , function ( ) {
45- if ( mainWindow != null ) {
46- mainWindow . webContents . send ( 'notify' , 'Update is available!' , 'Download started.. wait for the update ready.' )
47- }
53+ notify ( 'Update is available!' , 'Download started.. wait for the update ready.' )
4854 } )
4955 . on ( 'update-not-available' , function ( ) {
5056 if ( mainWindow != null && ! versionNotified ) {
5157 versionNotified = true
52- mainWindow . webContents . send ( ' notify' , 'Latest Build!! ' + versionText , 'Hope you to enjoy our app :D' )
58+ notify ( 'Latest Build!! ' + versionText , 'Hope you to enjoy our app :D' )
5359 }
5460 } )
5561
@@ -59,7 +65,7 @@ app.on('ready', function () {
5965 appQuit = true
6066 } )
6167
62- autoUpdater . setFeedURL ( 'http ://orbital.b00st.io/rokt33r/boost-dev/latest?version=' + version )
68+ autoUpdater . setFeedURL ( 'https ://orbital.b00st.io/rokt33r/boost-dev/latest?version=' + version )
6369
6470 var template = require ( './atom-lib/menu-template' )
6571 var menu = Menu . buildFromTemplate ( template )
0 commit comments