1
0
mirror of https://github.com/flarum/core.git synced 2025-08-07 17:07:19 +02:00

move index calculation back out of show

This commit is contained in:
Alexander Skvortsov
2020-07-07 21:46:01 -04:00
committed by Franz Liedke
parent cdcf64852e
commit 228c7b883d

View File

@@ -125,7 +125,6 @@ class PostStreamState {
show(posts) {
this.visibleStart = posts.length ? this.discussion.postIds().indexOf(posts[0].id()) : 0;
this.visibleEnd = this.sanitizeIndex(this.visibleStart + posts.length);
this.index = (this.visibleEnd + this.visibleStart) / 2;
this.description = posts.length ? dayjs(posts[Math.floor(posts.length / 2)].createdAt()).format('MMMM YYYY') : '';
}