mirror of
https://github.com/flarum/core.git
synced 2025-08-05 07:57:46 +02:00
chore: render after first post items once
This commit is contained in:
@@ -84,11 +84,13 @@ export default class PostStream extends Component {
|
|||||||
</div>
|
</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 }, [
|
return m.fragment({ ...attrs }, [
|
||||||
postStreamElement,
|
postStreamElement,
|
||||||
<div className="PostStream-item PostStream-afterFirstPost" key="afterFirstPost">
|
<div className="PostStream-item PostStream-afterFirstPost" key="afterFirstPost">
|
||||||
{this.afterFirstPostItems().toArray()}
|
{afterPostItems}
|
||||||
</div>,
|
</div>,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user