mirror of
https://github.com/flarum/framework.git
synced 2025-06-05 15:34:33 +08:00
Fix deleting posts causing subsequent posts to display incorrectly
This commit is contained in:
@ -160,9 +160,11 @@ class PostStream extends mixin(Component, evented) {
|
|||||||
this.posts.map((post, i) => {
|
this.posts.map((post, i) => {
|
||||||
var content;
|
var content;
|
||||||
var attributes = {};
|
var attributes = {};
|
||||||
attributes['data-index'] = attributes.key = this.visibleStart + i;
|
attributes['data-index'] = this.visibleStart + i;
|
||||||
|
|
||||||
if (post) {
|
if (post) {
|
||||||
|
attributes.key = 'post'+post.id();
|
||||||
|
|
||||||
var PostComponent = app.postComponentRegistry[post.contentType()];
|
var PostComponent = app.postComponentRegistry[post.contentType()];
|
||||||
content = PostComponent ? PostComponent.component({post}) : '';
|
content = PostComponent ? PostComponent.component({post}) : '';
|
||||||
attributes.config = fadeIn;
|
attributes.config = fadeIn;
|
||||||
@ -178,6 +180,8 @@ class PostStream extends mixin(Component, evented) {
|
|||||||
}
|
}
|
||||||
lastTime = post.time();
|
lastTime = post.time();
|
||||||
} else {
|
} else {
|
||||||
|
attributes.key = this.visibleStart + i;
|
||||||
|
|
||||||
content = PostLoading.component();
|
content = PostLoading.component();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user