From 9cc2cc568301a379355d297218a3feb2adae430f Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 20 Mar 2022 19:36:52 +1100 Subject: [PATCH] Fix asynchronous order of events for "mark all as read" button --- InvenTree/templates/InvenTree/notifications/inbox.html | 2 +- .../templates/InvenTree/notifications/notifications.html | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/InvenTree/templates/InvenTree/notifications/inbox.html b/InvenTree/templates/InvenTree/notifications/inbox.html index 7ec2a27b6a..d8f5190860 100644 --- a/InvenTree/templates/InvenTree/notifications/inbox.html +++ b/InvenTree/templates/InvenTree/notifications/inbox.html @@ -10,7 +10,7 @@ {% endblock %} {% block actions %} -
+
{% trans "Mark all as read" %}
diff --git a/InvenTree/templates/InvenTree/notifications/notifications.html b/InvenTree/templates/InvenTree/notifications/notifications.html index 89f10c3e3d..fedf8a1448 100644 --- a/InvenTree/templates/InvenTree/notifications/notifications.html +++ b/InvenTree/templates/InvenTree/notifications/notifications.html @@ -126,8 +126,12 @@ $("#mark-all").on('click', function() { { read: false, }, + { + success: function(response) { + updateNotificationTables(); + } + } ); - updateNotificationTables(); }); loadNotificationTable("#history-table", {