update scm viewlet based on initial selection

fixes #35497
This commit is contained in:
Joao Moreno 2017-10-03 15:33:37 +02:00
parent 3d63750fda
commit 587a1047bc

View file

@ -244,6 +244,10 @@ class MainPanel extends ViewletPanel {
this.list.setSelection([...selection.slice(0, index), ...selection.slice(index + 1)]);
}
getSelection(): ISCMRepository[] {
return this.list.getSelectedElements();
}
private splice(index: number, deleteCount: number, repositories: ISCMRepository[] = []): void {
const wasEmpty = this.list.length === 0;
@ -854,6 +858,7 @@ export class SCMViewlet extends PanelViewlet implements IViewModel {
this.addPanel(this.mainPanel, this.mainPanel.minimumSize, 0);
const selectionChangeDisposable = this.mainPanel.onSelectionChange(this.onSelectionChange, this);
this.onSelectionChange(this.mainPanel.getSelection());
this.mainPanelDisposable = toDisposable(() => {
this.removePanel(this.mainPanel);