Open the corresponding tab when a server is clicked in settings page

This commit is contained in:
Yuya Ochiai
2017-01-29 21:40:20 +09:00
parent e4d1ab2938
commit 803366872a
5 changed files with 24 additions and 7 deletions

View File

@@ -14,8 +14,9 @@ const appLauncher = new AutoLaunch({
isHidden: true
});
function backToIndex() {
remote.getCurrentWindow().loadURL('file://' + __dirname + '/index.html');
function backToIndex(index) {
const target = typeof index === 'undefined' ? 0 : index;
remote.getCurrentWindow().loadURL(`file://${__dirname}/index.html?index=${target}`);
}
const SettingsPage = React.createClass({
@@ -182,6 +183,7 @@ const SettingsPage = React.createClass({
onTeamsChange={this.handleTeamsChange}
updateTeam={this.updateTeam}
addServer={this.addServer}
onTeamClick={backToIndex}
/>
</Col>
</Row>