diff --git a/src/browser/settings.jsx b/src/browser/settings.jsx
index ca28f35d..a22aa4f1 100644
--- a/src/browser/settings.jsx
+++ b/src/browser/settings.jsx
@@ -47,6 +47,19 @@ var SettingsPage = React.createClass({
});
});
}
+
+ if (process.platform === 'darwin') {
+ var currentWindow = remote.getCurrentWindow();
+ if (currentWindow.tray) {
+ this.setState({
+ trayWasVisible: true
+ });
+ } else {
+ this.setState({
+ trayWasVisible: false
+ });
+ }
+ }
},
handleTeamsChange: function(teams) {
this.setState({
@@ -181,8 +194,8 @@ var SettingsPage = React.createClass({
}
if (process.platform === 'darwin') {
- options.push();
+ options.push();
}
if (process.platform === 'win32') {
diff --git a/src/main.js b/src/main.js
index 7505751a..f37d6782 100644
--- a/src/main.js
+++ b/src/main.js
@@ -358,6 +358,11 @@ app.on('ready', function() {
if (shouldShowTrayIcon()) {
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
+ // was restarted after setting "Show icon on menu bar"
+ mainWindow.tray = trayIcon;
+ }
}
// Open the DevTools.