2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-09-22 01:29:02 +00:00

Prevent call to setBadge when not on OSX

This commit is contained in:
Guilherme Pacheco 2015-08-06 00:34:32 -03:00
parent 054c7f9ad5
commit 5adf9d3a5d

View File

@ -41,7 +41,9 @@ app.on('ready', function() {
// if the window is focused, clear the badge // if the window is focused, clear the badge
mainWindow.on('focus', function () { mainWindow.on('focus', function () {
app.dock.setBadge(''); if (process.platform === 'darwin') {
app.dock.setBadge('');
}
}); });
mainWindow.on('closed', function() { mainWindow.on('closed', function() {
@ -51,9 +53,8 @@ app.on('ready', function() {
// listen for a notification message // listen for a notification message
ipc.on('notification-message', function(event, arg) { ipc.on('notification-message', function(event, arg) {
console.log(arg); // prints "ping"
if (arg === 'TITLE_CHANGED') { if (arg === 'TITLE_CHANGED') {
if (!mainWindow.isFocused()) { if (process.platform === 'darwin' && !mainWindow.isFocused()) {
app.dock.setBadge('●'); app.dock.setBadge('●');
} }
} }
@ -61,4 +62,4 @@ ipc.on('notification-message', function(event, arg) {
app.on('window-all-closed', function() { app.on('window-all-closed', function() {
app.quit(); app.quit();
}); });