Fix deleting posts causing subsequent posts to display incorrectly

This commit is contained in:
Toby Zerner
2015-06-24 11:46:43 +09:30
parent fee88508ba
commit 3b7c7de83b

View File

@ -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();
} }