Don't duplicate posts when the last post gets deleted.

This commit is contained in:
Nicolas Stepien 2011-12-11 17:58:01 +01:00
parent 3c889374fb
commit c590237d77
3 changed files with 4 additions and 2 deletions

View File

@ -2046,7 +2046,7 @@
_ref3 = $$('.reply', body).reverse();
for (_j = 0, _len2 = _ref3.length; _j < _len2; _j++) {
reply = _ref3[_j];
if (reply.id === id) break;
if (reply.id <= id) break;
$.prepend(frag, reply.parentNode.parentNode.parentNode);
}
newPosts = frag.childNodes.length;

View File

@ -1,4 +1,6 @@
master
- mayhem
fix 2.32.2 regression duplicating new posts in rare cases
2.23.2
- mayhem

View File

@ -1630,7 +1630,7 @@ updater =
id = $('td[id]', updater.br.previousElementSibling)?.id or 0
frag = d.createDocumentFragment()
for reply in $$('.reply', body).reverse()
if reply.id is id
if reply.id <= id #make sure to not insert older posts
break
$.prepend frag, reply.parentNode.parentNode.parentNode #table