From 5adf9d3a5d3f72043a61be89a2b98bc1230cd8b5 Mon Sep 17 00:00:00 2001 From: Guilherme Pacheco Date: Thu, 6 Aug 2015 00:34:32 -0300 Subject: [PATCH] Prevent call to setBadge when not on OSX --- app/main.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/main.js b/app/main.js index 8a08aef..fd80027 100644 --- a/app/main.js +++ b/app/main.js @@ -41,7 +41,9 @@ app.on('ready', function() { // if the window is focused, clear the badge mainWindow.on('focus', function () { - app.dock.setBadge(''); + if (process.platform === 'darwin') { + app.dock.setBadge(''); + } }); mainWindow.on('closed', function() { @@ -51,9 +53,8 @@ app.on('ready', function() { // listen for a notification message ipc.on('notification-message', function(event, arg) { - console.log(arg); // prints "ping" if (arg === 'TITLE_CHANGED') { - if (!mainWindow.isFocused()) { + if (process.platform === 'darwin' && !mainWindow.isFocused()) { app.dock.setBadge('●'); } } @@ -61,4 +62,4 @@ ipc.on('notification-message', function(event, arg) { app.on('window-all-closed', function() { app.quit(); -}); \ No newline at end of file +});