Mongo tabs UX fixes (#851)

* Fixed mongo tabs UX

* changed logic for new tab index

* moved index to tabs base

* removed getIndex method
This commit is contained in:
Srinath Narayanan
2021-06-08 00:17:55 +05:30
committed by GitHub
parent f296c00a1c
commit ee60f61cfe
5 changed files with 27 additions and 5 deletions

View File

@@ -1394,7 +1394,11 @@ export default class Explorer {
tab.hashLocation().startsWith(hashLocation)
) as TerminalTab[];
const index = terminalTabs.length + 1;
let index = 1;
if (terminalTabs.length > 0) {
index = terminalTabs[terminalTabs.length - 1].index + 1;
}
const newTab = new TerminalTab({
account: userContext.databaseAccount,
tabKind: ViewModels.CollectionTabKind.Terminal,
@@ -1407,6 +1411,7 @@ export default class Explorer {
onLoadStartKey: null,
container: this,
kind: kind,
index: index,
});
this.tabsManager.activateNewTab(newTab);