mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-15 18:26:15 +01:00
filter messages that are already inserted to DOM
This commit is contained in:
@@ -121,6 +121,12 @@ define('forum/chats', [
|
|||||||
if (!data) {
|
if (!data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
data = data.filter(function (chatMsg) {
|
||||||
|
return !$('[component="chat/message"][data-mid="' + chatMsg.messageId + '"]').length;
|
||||||
|
});
|
||||||
|
if (!data.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
messages.parseMessage(data, function (html) {
|
messages.parseMessage(data, function (html) {
|
||||||
var currentScrollTop = el.scrollTop();
|
var currentScrollTop = el.scrollTop();
|
||||||
var previousHeight = el[0].scrollHeight;
|
var previousHeight = el[0].scrollHeight;
|
||||||
|
|||||||
Reference in New Issue
Block a user