1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 09:26:34 +02:00

Add redraws after posts have been loaded from the API

This commit is contained in:
Alexander Skvortsov
2020-07-06 19:37:47 -04:00
committed by Franz Liedke
parent ba82969a58
commit f8d1c7a317

View File

@@ -204,7 +204,7 @@ class PostStreamState {
this.visibleEnd = this.count(); this.visibleEnd = this.count();
return this.loadRange(this.visibleStart, this.visibleEnd).then(() => m.redraw()); return this.loadRange(this.visibleStart, this.visibleEnd);
} }
/** /**
@@ -264,7 +264,6 @@ class PostStreamState {
*/ */
loadPage(start, end, backwards) { loadPage(start, end, backwards) {
console.log('loadPage'); console.log('loadPage');
const redraw = () => {};
this.loadPageTimeouts[start] = setTimeout( this.loadPageTimeouts[start] = setTimeout(
() => { () => {
@@ -332,7 +331,8 @@ class PostStreamState {
filter: { discussion: this.discussion.id() }, filter: { discussion: this.discussion.id() },
page: { near: number }, page: { near: number },
}) })
.then(this.show.bind(this)); .then(this.show.bind(this))
.then(() => m.redraw());
} }
/** /**
@@ -354,7 +354,9 @@ class PostStreamState {
this.reset(start, end); this.reset(start, end);
return this.loadRange(start, end).then(this.show.bind(this)); return this.loadRange(start, end)
.then(this.show.bind(this))
.then(() => m.redraw());
} }
/** /**