Skip to content

Commit

Permalink
activetab: Fix broken last active tab. (#420)
Browse files Browse the repository at this point in the history
This fixes an issue where the server tabs were not loading
according to the last active tab. This used to load last server
no matter what the last used server is.

Fixes - #416.
  • Loading branch information
akashnimare authored Feb 18, 2018
1 parent 55ae71c commit 2d07d40
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
5 changes: 0 additions & 5 deletions app/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,6 @@ app.on('ready', () => {
appMenu.setMenu(props);
});

ipcMain.on('register-server-tab-shortcut', (event, index) => {
// Array index == Shown index - 1
page.send('switch-server-tab', index - 1);
});

ipcMain.on('toggleAutoLauncher', (event, AutoLaunchValue) => {
setAutoLaunch(AutoLaunchValue);
});
Expand Down
3 changes: 2 additions & 1 deletion app/renderer/js/components/server-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ class ServerTab extends Tab {
shortcutText = `Ctrl+${shownIndex}`;
}

ipcRenderer.send('register-server-tab-shortcut', shownIndex);
// Array index == Shown index - 1
ipcRenderer.send('switch-server-tab', shownIndex - 1);

return shortcutText;
}
Expand Down
2 changes: 1 addition & 1 deletion app/renderer/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ class ServerManagerView {
});

ipcRenderer.on('switch-server-tab', (event, index) => {
this.activateTab(index);
this.activateLastTab(index);
});

ipcRenderer.on('reload-proxy', (event, showAlert) => {
Expand Down

0 comments on commit 2d07d40

Please sign in to comment.