This commit is contained in:
Stanislav Nikitin 2019-01-20 07:52:31 +05:00
parent 97353ead0f
commit 129c7275a7
No known key found for this signature in database
GPG Key ID: 106900B32F8192EE

View File

@ -44,7 +44,7 @@ function createWindow() {
mainWindow.setIcon(normalIcon); mainWindow.setIcon(normalIcon);
// Tray icon. Do not create it on macOS. // Tray icon. Do not create it on macOS.
if (app.platform != "darwin") { if (process.platform != "darwin") {
tray = new Tray(normalIcon); tray = new Tray(normalIcon);
const contextMenu = Menu.buildFromTemplate([ const contextMenu = Menu.buildFromTemplate([
{ label: 'Open Yandex.Mail window', type: 'normal', click: showHideMainWindow }, { label: 'Open Yandex.Mail window', type: 'normal', click: showHideMainWindow },
@ -87,7 +87,7 @@ app.on('activate', function () {
ipc.on("has-unread", function (event, count) { ipc.on("has-unread", function (event, count) {
mainWindow.setIcon(unreadIcon); mainWindow.setIcon(unreadIcon);
if (app.platform == "darwin") { if (process.platform == "darwin") {
app.setBadgeCount(count); app.setBadgeCount(count);
} else { } else {
tray.setImage(unreadIcon); tray.setImage(unreadIcon);
@ -96,7 +96,7 @@ ipc.on("has-unread", function (event, count) {
ipc.on("has-no-unread", function (event, count) { ipc.on("has-no-unread", function (event, count) {
mainWindow.setIcon(normalIcon); mainWindow.setIcon(normalIcon);
if (app.platform == "darwin") { if (process.platform == "darwin") {
app.setBadgeCount(count); app.setBadgeCount(count);
} else { } else {
tray.setImage(unreadIcon); tray.setImage(unreadIcon);