mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 05:14:23 +00:00
fix notifications being delayed
This commit is contained in:
@@ -28,7 +28,7 @@
|
|||||||
queue: [],
|
queue: [],
|
||||||
message: '',
|
message: '',
|
||||||
messageType: 'hide',
|
messageType: 'hide',
|
||||||
notificationDisplayTime: 1,
|
notificationDisplayTime: 0,
|
||||||
notificationPriority: 'normal',
|
notificationPriority: 'normal',
|
||||||
currentlyDisplayedNotificationID: 0,
|
currentlyDisplayedNotificationID: 0,
|
||||||
currentID: { 'critical': 0, 'medium': 1000, 'low': 100000 },
|
currentID: { 'critical': 0, 'medium': 1000, 'low': 100000 },
|
||||||
@@ -58,6 +58,9 @@
|
|||||||
this.notifications[ id ] = { 'message': message, 'showDuration': showDuration, 'messageType': messageType, 'priority': priority };
|
this.notifications[ id ] = { 'message': message, 'showDuration': showDuration, 'messageType': messageType, 'priority': priority };
|
||||||
this.queue.push( id );
|
this.queue.push( id );
|
||||||
console.log( 'scheduled notification: ' + id + ' (' + message + ')' );
|
console.log( 'scheduled notification: ' + id + ' (' + message + ')' );
|
||||||
|
if ( this.displayTimeCurrentNotification >= this.notificationDisplayTime ) {
|
||||||
|
this.handleNotifications();
|
||||||
|
}
|
||||||
return id;
|
return id;
|
||||||
},
|
},
|
||||||
cancelNotification ( id ) {
|
cancelNotification ( id ) {
|
||||||
@@ -75,6 +78,8 @@
|
|||||||
This methods should NOT be called in any other component than this one!
|
This methods should NOT be called in any other component than this one!
|
||||||
*/
|
*/
|
||||||
this.displayTimeCurrentNotification = 0;
|
this.displayTimeCurrentNotification = 0;
|
||||||
|
this.notificationDisplayTime = 0;
|
||||||
|
this.message = '';
|
||||||
this.queue.sort();
|
this.queue.sort();
|
||||||
if ( this.queue.length > 0 ) {
|
if ( this.queue.length > 0 ) {
|
||||||
this.message = this.notifications[ this.queue[ 0 ] ][ 'message' ];
|
this.message = this.notifications[ this.queue[ 0 ] ][ 'message' ];
|
||||||
@@ -141,6 +146,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transition: all 0.5s;
|
transition: all 0.5s;
|
||||||
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
|
||||||
.types {
|
.types {
|
||||||
|
|||||||
Reference in New Issue
Block a user