mirror of
https://github.com/nasa/openmct.git
synced 2025-04-12 05:40:17 +00:00
react to all noti adds not just active noti add
This commit is contained in:
parent
64763f5c24
commit
1854ca4b6f
@ -323,24 +323,25 @@ export default class NotificationAPI extends EventEmitter {
|
||||
notification = this._createNotification(notificationModel);
|
||||
|
||||
this.notifications.push(notification);
|
||||
this.emit('add', notification);
|
||||
this._setHighestSeverity();
|
||||
|
||||
/*
|
||||
Check if there is already an active (ie. visible) notification
|
||||
*/
|
||||
Check if there is already an active (ie. visible) notification
|
||||
*/
|
||||
if (!this.activeNotification && !notification?.model?.options?.minimized) {
|
||||
this._setActiveNotification(notification);
|
||||
} else if (!this.activeTimeout) {
|
||||
/*
|
||||
If there is already an active notification, time it out. If it's
|
||||
already got a timeout in progress (either because it has had
|
||||
timeout forced because of a queue of messages, or it had an
|
||||
autodismiss specified), leave it to run. Otherwise force a
|
||||
timeout.
|
||||
If there is already an active notification, time it out. If it's
|
||||
already got a timeout in progress (either because it has had
|
||||
timeout forced because of a queue of messages, or it had an
|
||||
autodismiss specified), leave it to run. Otherwise force a
|
||||
timeout.
|
||||
|
||||
This notification has been added to queue and will be
|
||||
serviced as soon as possible.
|
||||
*/
|
||||
This notification has been added to queue and will be
|
||||
serviced as soon as possible.
|
||||
*/
|
||||
this.activeTimeout = setTimeout(() => {
|
||||
this._dismissOrMinimize(activeNotification);
|
||||
}, DEFAULT_AUTO_DISMISS_TIMEOUT);
|
||||
|
@ -70,10 +70,12 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.openmct.notifications.on('notification', this.updateNotifications);
|
||||
this.openmct.notifications.on('add', this.updateNotifications);
|
||||
this.openmct.notifications.on('dismiss-all', this.updateNotifications);
|
||||
},
|
||||
unmounted() {
|
||||
this.openmct.notifications.off('notification', this.updateNotifications);
|
||||
this.openmct.notifications.off('add', this.updateNotifications);
|
||||
this.openmct.notifications.off('dismiss-all', this.updateNotifications);
|
||||
},
|
||||
methods: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user