From a286ec47119769a5b4e0b6258052d37d496b6e5d Mon Sep 17 00:00:00 2001 From: Davide Iadeluca Date: Mon, 30 Sep 2024 16:28:04 +0200 Subject: [PATCH] fix(core): revert extensibility improvements for `replyCountItem()` This fixes a breaking change with third-party extensions calling `replyCountItem()` and not expecting it to be an array. --- .../forum/components/DiscussionListItem.tsx | 34 +++++++------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/framework/core/js/src/forum/components/DiscussionListItem.tsx b/framework/core/js/src/forum/components/DiscussionListItem.tsx index 083918a13c..b61d4abfbc 100644 --- a/framework/core/js/src/forum/components/DiscussionListItem.tsx +++ b/framework/core/js/src/forum/components/DiscussionListItem.tsx @@ -128,7 +128,7 @@ export default class DiscussionListItem { - const items = new ItemList(); - + replyCountItem() { const discussion = this.attrs.discussion; const showUnread = !this.showRepliesCount() && discussion.isUnread(); if (showUnread) { - items.add( - 'unreadCount', + return ( , - 100 - ); - } else { - items.add( - 'count', - - - - - {app.translator.trans('core.forum.discussion_list.total_replies_a11y_label', { count: discussion.replyCount() })} - - , - 100 + ); } - return items; + return ( + + + + + {app.translator.trans('core.forum.discussion_list.total_replies_a11y_label', { count: discussion.replyCount() })} + + + ); } }