Ver código fonte

Fixes repo closed/opened eventing

main
Eric Amodio 1 ano atrás
pai
commit
283530122f
4 arquivos alterados com 12 adições e 2 exclusões
  1. +5
    -0
      src/git/gitProviderService.ts
  2. +2
    -1
      src/git/models/repository.ts
  3. +1
    -0
      src/views/nodes/repositoryNode.ts
  4. +4
    -1
      src/views/nodes/viewNode.ts

+ 5
- 0
src/git/gitProviderService.ts Ver arquivo

@ -440,6 +440,11 @@ export class GitProviderService implements Disposable {
// Send a notification that the repositories changed // Send a notification that the repositories changed
queueMicrotask(() => this.fireRepositoriesChanged([], [e.repository])); queueMicrotask(() => this.fireRepositoriesChanged([], [e.repository]));
} else if (e.changed(RepositoryChange.Opened, RepositoryChangeComparisonMode.Any)) {
this.updateContext();
// Send a notification that the repositories changed
queueMicrotask(() => this.fireRepositoriesChanged([e.repository], []));
} }
if (e.changed(RepositoryChange.Remotes, RepositoryChangeComparisonMode.Any)) { if (e.changed(RepositoryChange.Remotes, RepositoryChangeComparisonMode.Any)) {

+ 2
- 1
src/git/models/repository.ts Ver arquivo

@ -81,6 +81,7 @@ export const enum RepositoryChange {
Ignores = 101, Ignores = 101,
RemoteProviders = 102, RemoteProviders = 102,
Starred = 103, Starred = 103,
Opened = 104,
} }
export const enum RepositoryChangeComparisonMode { export const enum RepositoryChangeComparisonMode {
@ -459,7 +460,7 @@ export class Repository implements Disposable {
const changed = this._closed !== value; const changed = this._closed !== value;
this._closed = value; this._closed = value;
if (changed) { if (changed) {
this.fireChange(RepositoryChange.Closed);
this.fireChange(this._closed ? RepositoryChange.Closed : RepositoryChange.Opened);
} }
} }

+ 1
- 0
src/views/nodes/repositoryNode.ts Ver arquivo

@ -459,6 +459,7 @@ export class RepositoryNode extends SubscribeableViewNode
RepositoryChange.Config, RepositoryChange.Config,
RepositoryChange.Index, RepositoryChange.Index,
RepositoryChange.Heads, RepositoryChange.Heads,
RepositoryChange.Opened,
RepositoryChange.Status, RepositoryChange.Status,
RepositoryChange.Unknown, RepositoryChange.Unknown,
RepositoryChangeComparisonMode.Any, RepositoryChangeComparisonMode.Any,

+ 4
- 1
src/views/nodes/viewNode.ts Ver arquivo

@ -677,7 +677,10 @@ export abstract class RepositoryFolderNode<
return; return;
} }
if (e.changed(RepositoryChange.Starred, RepositoryChangeComparisonMode.Any)) {
if (
e.changed(RepositoryChange.Opened, RepositoryChangeComparisonMode.Any) ||
e.changed(RepositoryChange.Starred, RepositoryChangeComparisonMode.Any)
) {
void this.parent?.triggerChange(true); void this.parent?.triggerChange(true);
return; return;

Carregando…
Cancelar
Salvar