[MM-22585] Ctrl/Cmd+<num> now switches to tabs based on order (#1193)
* [MM-22585] Ctrl/Cmd+<num> now switches to tabs based on order * Added fix for hotkeying from SettingsPage
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user