Browse Source

Fixes GitLens view refreshing

main
Eric Amodio 6 years ago
parent
commit
26856a6a6a
2 changed files with 19 additions and 12 deletions
  1. +18
    -12
      src/views/gitExplorer.ts
  2. +1
    -0
      src/views/resultsExplorer.ts

+ 18
- 12
src/views/gitExplorer.ts View File

@ -74,6 +74,7 @@ export class GitExplorer extends Disposable implements TreeDataProvider
if (!initializing &&
!configuration.changed(e, configuration.name('gitExplorer').value) &&
!configuration.changed(e, configuration.name('explorers').value) &&
!configuration.changed(e, configuration.name('defaultGravatarsStyle').value)) return;
if (initializing || configuration.changed(e, configuration.name('gitExplorer')('enabled').value)) {
@ -84,22 +85,27 @@ export class GitExplorer extends Disposable implements TreeDataProvider
this.setAutoRefresh(Container.config.gitExplorer.autoRefresh);
}
let view = this.config.view;
if (view === GitExplorerView.Auto) {
view = Container.context.workspaceState.get<GitExplorerView>(WorkspaceState.GitExplorerView, GitExplorerView.Repository);
}
let view = this._view;
if (initializing) {
this._view = view;
setCommandContext(CommandContext.GitExplorerView, this._view);
if (initializing || configuration.changed(e, configuration.name('gitExplorer')('view').value)) {
view = this.config.view;
if (view === GitExplorerView.Auto) {
view = Container.context.workspaceState.get<GitExplorerView>(WorkspaceState.GitExplorerView, GitExplorerView.Repository);
}
this.setRoot(await this.getRootNode(window.activeTextEditor));
if (initializing) {
this._view = view;
setCommandContext(CommandContext.GitExplorerView, this._view);
this._disposable = window.registerTreeDataProvider('gitlens.gitExplorer', this);
}
else {
this.reset(view);
this.setRoot(await this.getRootNode(window.activeTextEditor));
this._disposable = window.registerTreeDataProvider('gitlens.gitExplorer', this);
return;
}
}
this.reset(view!);
}
private onRepositoriesChanged() {

+ 1
- 0
src/views/resultsExplorer.ts View File

@ -54,6 +54,7 @@ export class ResultsExplorer extends Disposable implements TreeDataProvider
if (!initializing &&
!configuration.changed(e, configuration.name('resultsExplorer').value) &&
!configuration.changed(e, configuration.name('explorers').value) &&
!configuration.changed(e, configuration.name('defaultGravatarsStyle').value)) return;
if (!initializing && this._roots.length !== 0) {

Loading…
Cancel
Save