Avoid hide-menubar functions when saving config except on Windows

This commit is contained in:
Yuya Ochiai
2016-01-15 00:20:17 +09:00
parent 54f7eb3657
commit ea33fc5c58
2 changed files with 7 additions and 4 deletions

View File

@@ -33,13 +33,15 @@ var SettingsPage = React.createClass({
handleSave: function() { handleSave: function() {
var config = { var config = {
teams: this.state.teams, teams: this.state.teams,
hideMenuBar: this.refs.hideMenuBar.getChecked(), hideMenuBar: this.state.hideMenuBar,
version: settings.version version: settings.version
}; };
settings.writeFileSync(this.props.configFile, config); settings.writeFileSync(this.props.configFile, config);
var currentWindow = remote.getCurrentWindow(); if (process.platform === 'win32') {
currentWindow.setAutoHideMenuBar(config.hideMenuBar); var currentWindow = remote.getCurrentWindow();
currentWindow.setMenuBarVisibility(!config.hideMenuBar); currentWindow.setAutoHideMenuBar(config.hideMenuBar);
currentWindow.setMenuBarVisibility(!config.hideMenuBar);
}
window.location = './index.html'; window.location = './index.html';
}, },
handleCancel: function() { handleCancel: function() {

View File

@@ -9,6 +9,7 @@ var upgradeV0toV1 = function(config_v0) {
name: 'Primary team', name: 'Primary team',
url: config_v0.url url: config_v0.url
}], }],
hideMenuBar: false,
version: 1 version: 1
}; };
}; };