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() {
var config = {
teams: this.state.teams,
hideMenuBar: this.refs.hideMenuBar.getChecked(),
hideMenuBar: this.state.hideMenuBar,
version: settings.version
};
settings.writeFileSync(this.props.configFile, config);
var currentWindow = remote.getCurrentWindow();
currentWindow.setAutoHideMenuBar(config.hideMenuBar);
currentWindow.setMenuBarVisibility(!config.hideMenuBar);
if (process.platform === 'win32') {
var currentWindow = remote.getCurrentWindow();
currentWindow.setAutoHideMenuBar(config.hideMenuBar);
currentWindow.setMenuBarVisibility(!config.hideMenuBar);
}
window.location = './index.html';
},
handleCancel: function() {

View File

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