mirror of
https://github.com/flarum/framework.git
synced 2025-05-24 07:39:56 +08:00
Don't add duplicate posts to a discussion
This commit is contained in:
@ -17,7 +17,11 @@ class Discussion extends Model {
|
||||
}
|
||||
|
||||
if (newData.links && newData.links.addedPosts) {
|
||||
[].push.apply(posts.linkage, newData.links.addedPosts.linkage);
|
||||
newData.links.addedPosts.linkage.forEach(linkage => {
|
||||
if (posts.linkage[posts.linkage.length - 1].id != linkage.id) {
|
||||
posts.linkage.push(linkage);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user