From cf1940aeb5a6391bae7624bc5cb30cfaae393bc6 Mon Sep 17 00:00:00 2001 From: ralf Date: Thu, 11 Apr 2024 16:39:31 +0200 Subject: [PATCH] * Notifications: if deleting all (visible) messages, directly return the next junk, to ease cleaning them up --- notifications/js/notificationajaxpopup.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/notifications/js/notificationajaxpopup.js b/notifications/js/notificationajaxpopup.js index 234aaf013a..4344810388 100644 --- a/notifications/js/notificationajaxpopup.js +++ b/notifications/js/notificationajaxpopup.js @@ -570,9 +570,11 @@ notifications.prototype.delete_all = function () { if (!notifymessages || Object.entries(notifymessages).length == 0) return false; - egw.request("notifications.notifications_ajax.delete_message", [notifymessages.map(d => d.id)]); + egw.request("notifications.notifications_ajax.delete_message", [Object.keys(notifymessages)]); notifymessages = {}; + _currentRawData = []; // otherwise response from delete_message/get_notifications might not get parsed this.total = 0; + this.counterUpdate(); jQuery("#egwpopup_list").empty(); egw.loading_prompt('popup_notifications', false); this.bell("inactive"); @@ -590,6 +592,7 @@ var keepLoadingPrompt = false; delete (notifymessages[id]); this.total -= 1; + this.counterUpdate(); if (nextNode.length > 0 && nextNode[0].id.match(/egwpopup_message_/ig) && egwpopup_message.hasClass('egwpopup_expanded')) { nextNode.trigger('click');