]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Check for dupe from insertNoticeItem()
authorSarven Capadisli <csarven@status.net>
Wed, 18 Nov 2009 19:15:55 +0000 (19:15 +0000)
committerSarven Capadisli <csarven@status.net>
Wed, 18 Nov 2009 19:15:55 +0000 (19:15 +0000)
plugins/Realtime/realtimeupdate.js

index 9030ad55184ffc97627f8b5a00c3729bac232e13..a2c4da113e01efe8f9100ab18af3ee13f9d03f2e 100644 (file)
@@ -66,13 +66,6 @@ RealtimeUpdate = {
 
      receive: function(data)
      {
 
      receive: function(data)
      {
-          id = data.id;
-
-          // Don't add it if it already exists
-          if ($("#notice-"+id).length > 0) {
-               return;
-          }
-
           if (RealtimeUpdate._paused === false) {
               RealtimeUpdate.purgeLastNoticeItem();
 
           if (RealtimeUpdate._paused === false) {
               RealtimeUpdate.purgeLastNoticeItem();
 
@@ -88,6 +81,11 @@ RealtimeUpdate = {
      },
 
      insertNoticeItem: function(data) {
      },
 
      insertNoticeItem: function(data) {
+        // Don't add it if it already exists
+        if ($("#notice-"+data.id).length > 0) {
+            return;
+        }
+
         var noticeItem = RealtimeUpdate.makeNoticeItem(data);
         $("#notices_primary .notices").prepend(noticeItem);
         $("#notices_primary .notice:first").css({display:"none"});
         var noticeItem = RealtimeUpdate.makeNoticeItem(data);
         $("#notices_primary .notices").prepend(noticeItem);
         $("#notices_primary .notice:first").css({display:"none"});
@@ -253,7 +251,7 @@ RealtimeUpdate = {
 
      updateQueuedCounter: function()
      {
 
      updateQueuedCounter: function()
      {
-        QC = $('#realtime_playpause #queued_counter').html('('+RealtimeUpdate._queuedNotices.length+')');
+        $('#realtime_playpause #queued_counter').html('('+RealtimeUpdate._queuedNotices.length+')');
      },
 
      removeQueuedCounter: function()
      },
 
      removeQueuedCounter: function()