summaryrefslogtreecommitdiff
path: root/plugins/Comet/updatetimeline.js
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-04-26 21:15:11 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-04-26 21:15:11 -0400
commite97223b2ba3f9f1818ba12b707c53c0ebdcab144 (patch)
treea64ed2e86b6f3b6d4194442708e87e78e0b866f5 /plugins/Comet/updatetimeline.js
parentdb3b56a2fdf51e97e9859aa731674947571667aa (diff)
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.
Diffstat (limited to 'plugins/Comet/updatetimeline.js')
-rw-r--r--plugins/Comet/updatetimeline.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/Comet/updatetimeline.js b/plugins/Comet/updatetimeline.js
index 55511d35f..de750baba 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"});