activetab: Fix broken last active tab. (#420)

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.
This commit is contained in:
Akash Nimare
2018-02-18 17:52:26 +05:30
committed by GitHub
parent 55ae71c00c
commit 2d07d40c92
3 changed files with 3 additions and 7 deletions

View File

@@ -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);
});

View File

@@ -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;
}

View File

@@ -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) => {