X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=2b19c36c539132c3d4c3bf3a8096738f32fbef16;hb=4287484dbc9747720f1c3ee34a4fd1fd7f097a9e;hp=591afa022e039890d5ded16e4a53866c12a1b694;hpb=67c3d6cf09d8e7784d6cc5e0c4116b12fe15dd00;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 591afa0..2b19c36 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -1091,7 +1091,7 @@ function ajaxifyNotification(notification) { * Returns the notification hash. This hash is used in {@link #getStatus()} to * determine whether the notifications changed and need to be reloaded. */ -public getNotificationHash() { +function getNotificationHash() { return $("#sone #notification-area #notification-hash").text(); } @@ -1101,7 +1101,7 @@ public getNotificationHash() { * @param notificationHash * The new notification hash */ -public setNotificationHash(notificationHash) { +function setNotificationHash(notificationHash) { $("#sone #notification-area #notification-hash").text(notificationHash); } @@ -1200,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");