mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 15:25:35 +08:00
FIX: correct stream counter when load more posts (#10264)
Small bug in that fix in which we started loading posts in partial: https://github.com/discourse/discourse/pull/10240 We should add only displayed partial to stream counter to have a correct total number.
This commit is contained in:
parent
de79f19947
commit
edc6c09500
|
@ -300,13 +300,13 @@ export default RestModel.extend({
|
|||
|
||||
if (idx !== -1) {
|
||||
// Insert the gap at the appropriate place
|
||||
stream.splice.apply(stream, [idx, 0].concat(gap));
|
||||
|
||||
let postIdx = currentPosts.indexOf(post);
|
||||
const origIdx = postIdx;
|
||||
|
||||
let headGap = gap.slice(0, this.topic.chunk_size);
|
||||
let tailGap = gap.slice(this.topic.chunk_size);
|
||||
stream.splice.apply(stream, [idx, 0].concat(headGap));
|
||||
if (postIdx !== -1) {
|
||||
return this.findPostsByIds(headGap).then(posts => {
|
||||
posts.forEach(p => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user