@@ -34,7 +34,14 @@ export interface NotificationSender {
34
34
export interface NotificationControllerDelegate {
35
35
openApp ( ) : void ;
36
36
openLink ( url : string , withAuth ?: boolean ) : Promise < void > ;
37
- showNotificationIcon ( value : boolean ) : void ;
37
+ /**
38
+ * We have experienced issues where the
39
+ * notification dot wasn't removed and logging the reason for it to be showing we can narrow the
40
+ * causes down.
41
+ *
42
+ * @param reason Used for debug purposes, it is currently all relevant notification messages..
43
+ */
44
+ showNotificationIcon ( value : boolean , reason ?: string ) : void ;
38
45
}
39
46
40
47
enum NotificationSuppressReason {
@@ -278,21 +285,19 @@ export default class NotificationController {
278
285
}
279
286
280
287
private updateNotificationIcon ( ) {
281
- for ( const notification of this . activeNotifications ) {
282
- if ( notification . specification . severity >= SystemNotificationSeverityType . medium ) {
283
- this . notificationControllerDelegate . showNotificationIcon ( true ) ;
284
- return ;
285
- }
286
- }
288
+ const activeNotifications = [ ... this . activeNotifications ] . map (
289
+ ( notification ) => notification . specification ,
290
+ ) ;
291
+ const notifications = [ ... activeNotifications , ... this . dismissedNotifications ] . filter (
292
+ ( notification ) => notification . severity >= SystemNotificationSeverityType . medium ,
293
+ ) ;
287
294
288
- for ( const notification of this . dismissedNotifications ) {
289
- if ( notification . severity >= SystemNotificationSeverityType . medium ) {
290
- this . notificationControllerDelegate . showNotificationIcon ( true ) ;
291
- return ;
292
- }
295
+ if ( notifications . length > 0 ) {
296
+ const reason = notifications . map ( ( notification ) => `" ${ notification . message } "` ) . join ( ',' ) ;
297
+ this . notificationControllerDelegate . showNotificationIcon ( true , reason ) ;
298
+ } else {
299
+ this . notificationControllerDelegate . showNotificationIcon ( false ) ;
293
300
}
294
-
295
- this . notificationControllerDelegate . showNotificationIcon ( false ) ;
296
301
}
297
302
298
303
private evaluateNotification (
0 commit comments