modal loop prevention #992

This commit is contained in:
jokob-sk
2025-02-16 10:06:34 +11:00
parent ffa0457342
commit a0e117f92e

View File

@@ -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() {