Skip to content

Commit

Permalink
Do not show scm repository icon in single project workspace
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Vinokur <ivinokur@redhat.com>
  • Loading branch information
vinokurig committed May 29, 2019
1 parent 93fb9e7 commit 7989d93
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions packages/scm/src/browser/scm-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,18 @@ export class ScmContribution extends AbstractViewContribution<ScmWidget> impleme
});
this.scmService.onDidChangeSelectedRepositories(repository => {
if (repository) {
const path = this.labelProvider.getName(new URI(repository.provider.rootUri));
this.statusBar.setElement(CHANGE_REPOSITORY.id, {
text: `$(database) ${path}`,
tooltip: path.toString(),
command: CHANGE_REPOSITORY.id,
alignment: StatusBarAlignment.LEFT,
priority: 100
});
if (this.scmService.repositories.length === 1) {
this.statusBar.removeElement(CHANGE_REPOSITORY.id);
} else {
const path = this.labelProvider.getName(new URI(repository.provider.rootUri));
this.statusBar.setElement(CHANGE_REPOSITORY.id, {
text: `$(database) ${path}`,
tooltip: path.toString(),
command: CHANGE_REPOSITORY.id,
alignment: StatusBarAlignment.LEFT,
priority: 100
});
}
} else {
this.statusBarCommands.forEach(id => {
this.statusBar.removeElement(id);
Expand Down

0 comments on commit 7989d93

Please sign in to comment.