瀏覽代碼

Fixes repo closed/opened eventing

main
Eric Amodio 1 年之前
父節點
當前提交
283530122f
共有 4 個文件被更改,包括 12 次插入2 次删除
  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 查看文件

@ -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 查看文件

@ -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 查看文件

@ -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 查看文件

@ -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;

Loading…
取消
儲存