Explorar el Código

Fixes repo closed/opened eventing

main
Eric Amodio hace 1 año
padre
commit
283530122f
Se han modificado 4 ficheros con 12 adiciones y 2 borrados
  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 fichero

@ -440,6 +440,11 @@ export class GitProviderService implements Disposable {
// Send a notification that the repositories changed
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)) {

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

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

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

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

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

@ -677,7 +677,10 @@ export abstract class RepositoryFolderNode<
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);
return;

Cargando…
Cancelar
Guardar