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') {
|
||||
var currentWindow = remote.getCurrentWindow();
|
||||
if (currentWindow.tray) {
|
||||
this.setState({
|
||||
trayWasVisible: true
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
trayWasVisible: false
|
||||
});
|
||||
}
|
||||
this.setState({
|
||||
trayWasVisible: currentWindow.trayWasVisible
|
||||
});
|
||||
}
|
||||
},
|
||||
handleTeamsChange: function(teams) {
|
||||
|
@@ -359,9 +359,12 @@ app.on('ready', function() {
|
||||
const tray_menu = require('./main/menus/tray').createDefault(mainWindow);
|
||||
trayIcon.setContextMenu(tray_menu);
|
||||
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"
|
||||
mainWindow.tray = trayIcon;
|
||||
if (trayIcon)
|
||||
mainWindow.trayWasVisible = true;
|
||||
else
|
||||
mainWindow.trayWasVisible = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user