]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Don't add a notice if it already exists on the page
authorEvan Prodromou <evan@controlyourself.ca>
Mon, 27 Apr 2009 01:15:11 +0000 (21:15 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Mon, 27 Apr 2009 01:15:11 +0000 (21:15 -0400)
Try not to interfere with Ajax posting; don't show something if it's
already on the page.

plugins/Comet/updatetimeline.js

index 55511d35ff08485ba50849981e139549ad831ad2..de750baba333551596e0f3b32af2b8944751f000 100644 (file)
@@ -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"});