ELECTRON-1425 & ELECTRON-1405 - Clear displayTimer & move notification to top when setting notification content (#741)

This commit is contained in:
Kiran Niranjan 2019-07-19 14:44:11 +05:30 committed by Vishwas Shashidhar
parent abfda29141
commit dbd3c05631

View File

@ -170,6 +170,13 @@ class Notification extends NotificationHandler {
const displayTime = data.displayTime ? data.displayTime : notificationSettings.displayTime;
let timeoutId;
// Reset the display timer
if (notificationWindow.displayTimer) {
clearTimeout(notificationWindow.displayTimer);
}
// Move notification to top
notificationWindow.moveTop();
if (!data.sticky) {
timeoutId = setTimeout(async () => {
await this.hideNotification(notificationWindow.clientId);