X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=60770495166e9eef9d00ae36c0389a770a60b751;hp=414dd02d3153ff7529fad43c20e44651e11eb79c;hb=632116a9843914f931e6bc3e2d56a0b1961a4db9;hpb=81ebd8d01efe947d6c2e4f0fe263730c59ff6dca diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 414dd02..6077049 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -1206,15 +1206,15 @@ function getStatus() { if (data.notificationHash != getNotificationHash()) { console.log("Old hash: ", getNotificationHash(), ", new hash: ", data.notificationHash); requestNotifications(); + /* process new posts. */ + $.each(data.newPosts, function(index, value) { + loadNewPost(value.id, value.sone, value.recipient, value.time); + }); + /* process new replies. */ + $.each(data.newReplies, function(index, value) { + loadNewReply(value.id, value.sone, value.post, value.postSone); + }); } - /* process new posts. */ - $.each(data.newPosts, function(index, value) { - loadNewPost(value.id, value.sone, value.recipient, value.time); - }); - /* process new replies. */ - $.each(data.newReplies, function(index, value) { - loadNewReply(value.id, value.sone, value.post, value.postSone); - }); /* do it again in 5 seconds. */ setTimeout(getStatus, 5000); } else {