提交 71631bf2 编写于 作者: S Sandeep Somavarapu

Fix #51396

上级 c97ccef9
......@@ -127,7 +127,7 @@ export class ActivityActionItem extends BaseActionItem {
super(null, action, options);
this.themeService.onThemeChange(this.onThemeChange, this, this._callOnDispose);
action.onDidChangeBadge(this.handleBadgeChangeEvenet, this, this._callOnDispose);
action.onDidChangeBadge(this.updateBadge, this, this._callOnDispose);
}
protected get activity(): IActivity {
......@@ -200,17 +200,22 @@ export class ActivityActionItem extends BaseActionItem {
this.$badge.hide();
this.updateStyles();
this.updateBadge();
}
private onThemeChange(theme: ITheme): void {
this.updateStyles();
}
protected updateBadge(badge: IBadge, clazz?: string): void {
if (!this.$badge || !this.$badgeContent) {
protected updateBadge(): void {
const action = this.getAction();
if (!this.$badge || !this.$badgeContent || !(action instanceof ActivityAction)) {
return;
}
const badge = action.getBadge();
const clazz = action.getClass();
this.badgeDisposable.dispose();
this.badgeDisposable = empty;
......@@ -275,13 +280,6 @@ export class ActivityActionItem extends BaseActionItem {
});
}
private handleBadgeChangeEvenet(): void {
const action = this.getAction();
if (action instanceof ActivityAction) {
this.updateBadge(action.getBadge(), action.getClass());
}
}
public dispose(): void {
super.dispose();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册