From: Evan Prodromou Date: Mon, 27 Apr 2009 01:15:11 +0000 (-0400) Subject: Don't add a notice if it already exists on the page X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e97223b2ba3f9f1818ba12b707c53c0ebdcab144;p=quix0rs-gnu-social.git Don't add a notice if it already exists on the page Try not to interfere with Ajax posting; don't show something if it's already on the page. --- diff --git a/plugins/Comet/updatetimeline.js b/plugins/Comet/updatetimeline.js index 55511d35ff..de750baba3 100644 --- a/plugins/Comet/updatetimeline.js +++ b/plugins/Comet/updatetimeline.js @@ -23,6 +23,14 @@ var updater = function() function receive(message) { + id = message.data.id; + + // Don't add it if it already exists + + if ($("#notice-"+id).length > 0) { + return; + } + var noticeItem = makeNoticeItem(message.data); $("#notices_primary .notices").prepend(noticeItem, true); $("#notices_primary .notice:first").css({display:"none"});