Skip to content

Commit d4d1c32

Browse files
committed
notification デバッグ
1 parent e4f39d2 commit d4d1c32

2 files changed

Lines changed: 18 additions & 12 deletions

File tree

browser/main/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ function notify (...args) {
2424
return new window.Notification(...args)
2525
}
2626

27-
ipc.on('notify', function (title, message) {
28-
notify(title, {
29-
body: message
27+
ipc.on('notify', function (e, payload) {
28+
notify(payload.title, {
29+
body: payload.body
3030
})
3131
})
3232

main.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,40 @@ var appQuit = false
2222
var version = app.getVersion()
2323
var versionText = (version == null || version.length === 0) ? 'DEV version' : 'v' + version
2424
var 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+
2535
autoUpdater
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

Comments
 (0)