Close core error notification on subsequent action

Closes #1154

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
Akos Kitta
2022-08-11 12:05:19 +02:00
committed by Akos Kitta
parent 5226636fed
commit 989300f25d
5 changed files with 43 additions and 3 deletions

View File

@@ -1,9 +1,10 @@
import { injectable } from '@theia/core/shared/inversify';
import { CancellationToken } from '@theia/core/lib/common/cancellation';
import {
import type {
Message,
ProgressMessage,
ProgressUpdate,
} from '@theia/core/lib/common/message-service-protocol';
import { injectable } from '@theia/core/shared/inversify';
import { NotificationManager as TheiaNotificationManager } from '@theia/messages/lib/browser/notifications-manager';
@injectable()
@@ -34,7 +35,9 @@ export class NotificationManager extends TheiaNotificationManager {
this.fireUpdatedEvent();
}
protected override toPlainProgress(update: ProgressUpdate): number | undefined {
protected override toPlainProgress(
update: ProgressUpdate
): number | undefined {
if (!update.work) {
return undefined;
}
@@ -43,4 +46,11 @@ export class NotificationManager extends TheiaNotificationManager {
}
return Math.min((update.work.done / update.work.total) * 100, 100);
}
/**
* For `public` visibility.
*/
override getMessageId(message: Message): string {
return super.getMessageId(message);
}
}