提交 a2af8439 编写于 作者: S Sandeep Somavarapu

fix #75620

上级 4a8df0b2
......@@ -631,11 +631,6 @@ export class StatusUpdater extends Disposable implements IWorkbenchContribution
private onServiceChange(): void {
this.badgeHandle.clear();
if (this.extensionsWorkbenchService.local.some(e => e.state === ExtensionState.Installing)) {
this.badgeHandle.value = this.activityService.showActivity(VIEWLET_ID, new ProgressBadge(() => localize('extensions', "Extensions")), 'extensions-badge progress-badge');
return;
}
const outdated = this.extensionsWorkbenchService.outdated.reduce((r, e) => r + (this.extensionEnablementService.isEnabled(e.local!) ? 1 : 0), 0);
if (outdated > 0) {
const badge = new NumberBadge(outdated, n => localize('outdatedExtensions', '{0} Outdated Extensions', n));
......
......@@ -536,6 +536,8 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
this.resetIgnoreAutoUpdateExtensions();
this.eventuallySyncWithGallery(true);
});
this._register(this.onChange(() => this.updateActivity()));
}
get local(): IExtension[] {
......@@ -1025,6 +1027,21 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
return this._extensionAllowedBadgeProviders;
}
private _activityCallBack: (() => void) | null = null;
private updateActivity(): void {
if ((this.localExtensions && this.localExtensions.local.some(e => e.state === ExtensionState.Installing || e.state === ExtensionState.Uninstalling))
|| (this.remoteExtensions && this.remoteExtensions.local.some(e => e.state === ExtensionState.Installing || e.state === ExtensionState.Uninstalling))) {
if (!this._activityCallBack) {
this.progressService.withProgress({ location: ProgressLocation.Extensions }, () => new Promise(c => this._activityCallBack = c));
}
} else {
if (this._activityCallBack) {
this._activityCallBack();
}
this._activityCallBack = null;
}
}
private onError(err: any): void {
if (isPromiseCanceledError(err)) {
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册