Show NewServerModal when no servers exist in SettingsPage

This commit is contained in:
Yuya Ochiai
2017-02-13 20:23:02 +09:00
parent c76797e68e
commit 9d2efeabdd
3 changed files with 24 additions and 1 deletions

View File

@@ -34,6 +34,9 @@ const SettingsPage = React.createClass({
initialState.showAddTeamForm = false;
initialState.trayWasVisible = remote.getCurrentWindow().trayWasVisible;
initialState.disableClose = initialState.teams.length === 0;
if (initialState.teams.length === 0) {
initialState.showAddTeamForm = true;
}
return initialState;
},
@@ -57,6 +60,9 @@ const SettingsPage = React.createClass({
showAddTeamForm: false,
teams
});
if (teams.length === 0) {
this.setState({showAddTeamForm: true});
}
},
handleSave() {
var config = {