SCM - fix badge regression (#221738)

This commit is contained in:
Ladislau Szomoru 2024-07-15 20:48:47 +02:00 committed by GitHub
parent 5491dc90d7
commit fbcb0742aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -72,11 +72,11 @@ export class SCMActiveRepositoryController extends Disposable implements IWorkbe
switch (this._countBadgeConfig.read(reader)) {
case 'all': {
const repositories = this._repositories.read(reader);
return [...Iterable.map(repositories, r => ({ ...r.provider, resourceCount: this._getRepositoryResourceCount(r) }))];
return [...Iterable.map(repositories, r => ({ provider: r.provider, resourceCount: this._getRepositoryResourceCount(r) }))];
}
case 'focused': {
const repository = this._activeRepository.read(reader);
return repository ? [{ ...repository.provider, resourceCount: this._getRepositoryResourceCount(repository) }] : [];
return repository ? [{ provider: repository.provider, resourceCount: this._getRepositoryResourceCount(repository) }] : [];
}
case 'off':
return [];
@ -89,7 +89,7 @@ export class SCMActiveRepositoryController extends Disposable implements IWorkbe
let total = 0;
for (const repository of this._countBadgeRepositories.read(reader)) {
const count = repository.count?.read(reader);
const count = repository.provider.count?.read(reader);
const resourceCount = repository.resourceCount.read(reader);
total = total + (count ?? resourceCount);