mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 00:04:14 +08:00
Fix #51396
This commit is contained in:
parent
c97ccef9cd
commit
71631bf2cd
@ -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();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user