1
0
mirror of https://github.com/flarum/core.git synced 2025-08-04 23:47:32 +02:00

chore: render after first post items once

This commit is contained in:
Sami Mazouz
2025-02-14 09:32:53 +01:00
parent 9977d491cf
commit 973f4f6f6b

View File

@@ -84,11 +84,13 @@ export default class PostStream extends Component {
</div>
);
if (post && post.id() === this.discussion.data.relationships.firstPost?.data.id && this.afterFirstPostItems().toArray().length > 0) {
const afterPostItems = post && post.id() === this.discussion.data.relationships.firstPost?.data.id ? this.afterFirstPostItems().toArray() : [];
if (afterPostItems.length > 0) {
return m.fragment({ ...attrs }, [
postStreamElement,
<div className="PostStream-item PostStream-afterFirstPost" key="afterFirstPost">
{this.afterFirstPostItems().toArray()}
{afterPostItems}
</div>,
]);
}