Add ability to hide tray icon on non-Mac (which has no tray icon)

This commit is contained in:
Michael Telatynski 2019-10-29 11:37:42 +00:00
parent 6ada5e4397
commit 1498872214
3 changed files with 44 additions and 10 deletions

View file

@ -26,6 +26,13 @@ exports.hasTray = function hasTray() {
return (trayIcon !== null);
};
exports.destroy = function() {
if (trayIcon) {
trayIcon.destroy();
trayIcon = null;
}
};
exports.create = function(config) {
// no trays on darwin
if (process.platform === 'darwin' || trayIcon) return;