Skip to content

Commit 2d07d40

Browse files
authored
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.
1 parent 55ae71c commit 2d07d40

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

app/main/index.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,6 @@ app.on('ready', () => {
221221
appMenu.setMenu(props);
222222
});
223223

224-
ipcMain.on('register-server-tab-shortcut', (event, index) => {
225-
// Array index == Shown index - 1
226-
page.send('switch-server-tab', index - 1);
227-
});
228-
229224
ipcMain.on('toggleAutoLauncher', (event, AutoLaunchValue) => {
230225
setAutoLaunch(AutoLaunchValue);
231226
});

app/renderer/js/components/server-tab.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ class ServerTab extends Tab {
5050
shortcutText = `Ctrl+${shownIndex}`;
5151
}
5252

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

5556
return shortcutText;
5657
}

app/renderer/js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ class ServerManagerView {
419419
});
420420

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

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

0 commit comments

Comments
 (0)