Przeglądaj źródła

Fixes GitLens view refreshing

main
Eric Amodio 6 lat temu
rodzic
commit
26856a6a6a
2 zmienionych plików z 19 dodań i 12 usunięć
  1. +18
    -12
      src/views/gitExplorer.ts
  2. +1
    -0
      src/views/resultsExplorer.ts

+ 18
- 12
src/views/gitExplorer.ts Wyświetl plik

@ -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 Wyświetl plik

@ -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) {

Ładowanie…
Anuluj
Zapisz