diff --git a/framework/core/js/src/forum/components/PostStream.js b/framework/core/js/src/forum/components/PostStream.js index 5310cf6428..13aa8aeb7f 100644 --- a/framework/core/js/src/forum/components/PostStream.js +++ b/framework/core/js/src/forum/components/PostStream.js @@ -78,11 +78,24 @@ export default class PostStream extends Component { content = ; } - return ( + const postStreamElement = (
{content}
); + + // If we're on the first post, call the afterFirstPostItems method and add any additional elements. + if (i === 0 && this.afterFirstPostItems().toArray().length > 0) { + // Using m.fragment to return multiple elements without an enclosing container + return m.fragment({ ...attrs }, [ + postStreamElement, +
+ {this.afterFirstPostItems().toArray()} +
, + ]); + } + + return postStreamElement; }); if (!viewingEnd && posts[this.stream.visibleEnd - this.stream.visibleStart - 1]) { @@ -117,6 +130,15 @@ export default class PostStream extends Component { ); } + /** + * @returns {ItemList} + */ + afterFirstPostItems() { + const items = new ItemList(); + + return items; + } + /** * @returns {ItemList} */