Skip to content

Commit

Permalink
Don't switch tab everytime there is a model change
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Jun 27, 2023
1 parent 8ca6c22 commit 2d1a88f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/viewPanel/sessionWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export class SessionWidget extends BoxPanel {

private async _onTabsChanged() {
await this._pythonSessionCreated.promise;
let newTabIndex = 1;
let newTabIndex: number | undefined = undefined;
const currentIndex = this._tabPanel.topBar.currentIndex;
const tabNames = this._model.getTabNames();

Expand Down Expand Up @@ -184,10 +184,12 @@ export class SessionWidget extends BoxPanel {
// todo
// }
// }
if (currentIndex === 0) {
newTabIndex = 0;
if (newTabIndex !== undefined) {
if (currentIndex === 0) {
newTabIndex = 0;
}
this._tabPanel.activateTab(newTabIndex + 1);
}
this._tabPanel.activateTab(newTabIndex + 1);
}

private _onFocusedTabChanged(
Expand Down

0 comments on commit 2d1a88f

Please sign in to comment.