Merge pull request #119878 from microsoft/isidorn/notificationVisible
add visible flag to notification
This commit is contained in:
commit
ff869cd358
2 changed files with 11 additions and 2 deletions
|
@ -90,7 +90,9 @@ export function registerNotificationCommands(center: INotificationsCenterControl
|
|||
handler: accessor => {
|
||||
const telemetryService = accessor.get(ITelemetryService);
|
||||
model.notifications.forEach(n => {
|
||||
telemetryService.publicLog2<NotificationMetrics, NotificationMetricsClassification>('notification:hide', notificationToMetrics(n.message.original, n.sourceId, n.silent));
|
||||
if (n.visible) {
|
||||
telemetryService.publicLog2<NotificationMetrics, NotificationMetricsClassification>('notification:hide', notificationToMetrics(n.message.original, n.sourceId, n.silent));
|
||||
}
|
||||
});
|
||||
|
||||
center.hide();
|
||||
|
@ -171,7 +173,9 @@ export function registerNotificationCommands(center: INotificationsCenterControl
|
|||
CommandsRegistry.registerCommand(HIDE_NOTIFICATION_TOAST, accessor => {
|
||||
const telemetryService = accessor.get(ITelemetryService);
|
||||
model.notifications.forEach(n => {
|
||||
telemetryService.publicLog2<NotificationMetrics, NotificationMetricsClassification>('notification:hide', notificationToMetrics(n.message.original, n.sourceId, n.silent));
|
||||
if (n.visible) {
|
||||
telemetryService.publicLog2<NotificationMetrics, NotificationMetricsClassification>('notification:hide', notificationToMetrics(n.message.original, n.sourceId, n.silent));
|
||||
}
|
||||
});
|
||||
toasts.hide();
|
||||
});
|
||||
|
|
|
@ -285,6 +285,7 @@ export interface INotificationViewItem {
|
|||
readonly progress: INotificationViewItemProgress;
|
||||
|
||||
readonly expanded: boolean;
|
||||
readonly visible: boolean;
|
||||
readonly canCollapse: boolean;
|
||||
readonly hasProgress: boolean;
|
||||
|
||||
|
@ -611,6 +612,10 @@ export class NotificationViewItem extends Disposable implements INotificationVie
|
|||
return this._actions;
|
||||
}
|
||||
|
||||
get visible(): boolean {
|
||||
return this._visible;
|
||||
}
|
||||
|
||||
updateSeverity(severity: Severity): void {
|
||||
this._severity = severity;
|
||||
this._onDidChangeContent.fire({ kind: NotificationViewItemContentChangeKind.SEVERITY });
|
||||
|
|
Loading…
Reference in a new issue