Makes the check for the tray icon a bit more lightweight
This commit is contained in:
@@ -50,15 +50,9 @@ var SettingsPage = React.createClass({
|
|||||||
|
|
||||||
if (process.platform === 'darwin') {
|
if (process.platform === 'darwin') {
|
||||||
var currentWindow = remote.getCurrentWindow();
|
var currentWindow = remote.getCurrentWindow();
|
||||||
if (currentWindow.tray) {
|
this.setState({
|
||||||
this.setState({
|
trayWasVisible: currentWindow.trayWasVisible
|
||||||
trayWasVisible: true
|
});
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.setState({
|
|
||||||
trayWasVisible: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleTeamsChange: function(teams) {
|
handleTeamsChange: function(teams) {
|
||||||
|
@@ -359,9 +359,12 @@ app.on('ready', function() {
|
|||||||
const tray_menu = require('./main/menus/tray').createDefault(mainWindow);
|
const tray_menu = require('./main/menus/tray').createDefault(mainWindow);
|
||||||
trayIcon.setContextMenu(tray_menu);
|
trayIcon.setContextMenu(tray_menu);
|
||||||
if (process.platform === 'darwin') {
|
if (process.platform === 'darwin') {
|
||||||
// store a reference to the tray icon, for checking in the settings, if the application
|
// store the information, if the tray was initialized, for checking in the settings, if the application
|
||||||
// was restarted after setting "Show icon on menu bar"
|
// was restarted after setting "Show icon on menu bar"
|
||||||
mainWindow.tray = trayIcon;
|
if (trayIcon)
|
||||||
|
mainWindow.trayWasVisible = true;
|
||||||
|
else
|
||||||
|
mainWindow.trayWasVisible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user