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:
committed by
Franz Liedke
parent
cdcf64852e
commit
228c7b883d
@@ -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') : '';
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user