diff --git a/src/webapp/src/components/notifications/notifications.vue b/src/webapp/src/components/notifications/notifications.vue index c2a7647..c6ba5a1 100644 --- a/src/webapp/src/components/notifications/notifications.vue +++ b/src/webapp/src/components/notifications/notifications.vue @@ -7,6 +7,7 @@ close progress_activity info + warning
@@ -55,7 +56,7 @@ this.currentID[ 'low' ] += 1; id = this.currentID[ 'low' ]; } - this.notifications[ id ] = { 'message': message, 'showDuration': showDuration, 'messageType': messageType, 'priority': priority }; + this.notifications[ id ] = { 'message': message, 'showDuration': showDuration, 'messageType': messageType, 'priority': priority, 'id': id }; this.queue.push( id ); console.log( 'scheduled notification: ' + id + ' (' + message + ')' ); if ( this.displayTimeCurrentNotification >= this.notificationDisplayTime ) { @@ -67,8 +68,12 @@ /* This method deletes a notification and, in case the notification is being displayed, hides it. */ - delete notifications[ id ]; - delete this.queue[ this.queue.findIndex( id ) ]; + try { + delete notifications[ id ]; + delete this.queue[ this.queue.findIndex( id ) ]; + } catch ( error ) { + console.log( 'notification to be deleted is nonexistent or currently being displayed' ); + } if ( this.currentlyDisplayedNotificationID == id ) { this.handleNotifications(); } @@ -85,6 +90,7 @@ this.message = this.notifications[ this.queue[ 0 ] ][ 'message' ]; this.messageType = this.notifications[ this.queue[ 0 ] ][ 'messageType' ]; this.priority = this.notifications[ this.queue[ 0 ] ][ 'priority' ]; + this.currentlyDisplayedNotificationID = this.notifications[ this.queue[ 0 ] ][ 'id' ]; this.notificationDisplayTime = this.notifications[ this.queue[ 0 ] ][ 'showDuration' ]; this.queue.reverse(); this.queue.pop(); @@ -111,7 +117,7 @@ + \ No newline at end of file