Unverified Commit 4e8a3aa0 authored by Tasso Evangelista's avatar Tasso Evangelista Committed by GitHub

Merge pull request #875 from HappyTobi/develop

[FIX] Toggled tray icon notifications
parents f268c07f b36d3103
......@@ -130,7 +130,8 @@ function showTrayAlert (badge, status = 'online') {
if (mainWindow.tray === null || mainWindow.tray === undefined) {
return;
}
mainWindow.tray.setImage(getTrayImagePath(badge));
const trayDisplayed = localStorage.getItem('hideTray') === 'true';
const hasMentions = badge.showAlert && badge.count > 0;
if (!mainWindow.isFocused()) {
......@@ -155,13 +156,19 @@ function showTrayAlert (badge, status = 'online') {
if (hasMentions) {
trayTitle = `${statusBullet[status]} ${countColor}${badge.title}`;
}
mainWindow.tray.setTitle(trayTitle);
remote.app.dock.setBadge(badge.title);
if (trayDisplayed) {
mainWindow.tray.setTitle(trayTitle);
}
}
if (process.platform === 'linux') {
remote.app.setBadgeCount(badge.count);
}
if (trayDisplayed) {
mainWindow.tray.setImage(getTrayImagePath(badge));
}
}
function removeAppTray () {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment