mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
modal loop prevention #992
This commit is contained in:
@@ -310,7 +310,6 @@ function checkNotification() {
|
||||
|
||||
if(response != "[]")
|
||||
{
|
||||
|
||||
// Find the oldest unread notification with level "interrupt"
|
||||
const oldestInterruptNotification = response.find(notification => notification.read === 0 && notification.level === "interrupt");
|
||||
const allUnreadNotification = response.filter(notification => notification.read === 0 && notification.level === "alert");
|
||||
@@ -322,6 +321,9 @@ function checkNotification() {
|
||||
|
||||
const decodedContent = safeDecodeURIComponent(oldestInterruptNotification.content);
|
||||
|
||||
// only check and display modal if no modal currently displayed to prevent looping
|
||||
if($("#modal-ok").is(":visible") == false)
|
||||
{
|
||||
showModalOK("Notification", decodedContent, function() {
|
||||
// Mark the notification as read
|
||||
$.ajax({
|
||||
@@ -346,10 +348,9 @@ function checkNotification() {
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
handleUnreadNotifications(allUnreadNotification.length)
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
|
||||
Reference in New Issue
Block a user