X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=78d68f1e6e89bf51fb02e80606802e0a3604d259;hb=8b79b93bead78de036c5a8fa2e8964e4acde3d4f;hp=abf3fbd68610ed5b37306600db42c1b6f2fbaf3c;hpb=01189866db427f28e1f51fc52ac5cbdb2b4b5ece;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index abf3fbd..78d68f1 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -1096,6 +1096,16 @@ public getNotificationHash() { } /** + * Sets the notification hash. + * + * @param notificationHash + * The new notification hash + */ +public setNotificationHash(notificationHash) { + $("#sone #notification-area #notification-hash").text(notificationHash); +} + +/** * Retrieves element IDs from notification elements. * * @param notification @@ -1190,6 +1200,10 @@ function getStatus() { if (!notLoggedIn) { showOfflineMarker(!online); } + if (data.notificationHash != getNotificationHash()) { + console.log("Old hash: ", getNotificationHash(), ", new hash: ", data.notificationHash); + setNotificationHash(data.notificationHash); + } /* search for removed notifications. */ $("#sone #notification-area .notification").each(function() { notificationId = $(this).attr("id");