diff --git a/src/browser/components/MainPage.jsx b/src/browser/components/MainPage.jsx index 0f772223..725bc3b2 100644 --- a/src/browser/components/MainPage.jsx +++ b/src/browser/components/MainPage.jsx @@ -34,7 +34,7 @@ export default class MainPage extends React.Component { constructor(props) { super(props); - let key = this.props.initialIndex; + let key = this.props.teams.findIndex((team) => team.order === this.props.initialIndex); if (this.props.deeplinkingUrl !== null) { const parsedDeeplink = this.parseDeeplinkURL(this.props.deeplinkingUrl); if (parsedDeeplink) { @@ -153,7 +153,8 @@ export default class MainPage extends React.Component { // can't switch tabs sequentially for some reason... ipcRenderer.on('switch-tab', (event, key) => { - this.handleSelect(key); + const nextIndex = this.props.teams.findIndex((team) => team.order === key); + this.handleSelect(nextIndex); }); ipcRenderer.on('select-next-tab', () => { const currentOrder = this.props.teams[this.state.key].order;