Skip to content

A platform for community discussion. Free, open, simple.

DEV: Pass `navigateToTopic` action to topic-list-item outlet (#31068)

Jarek Radoszf9455491236c
diff --git a/app/assets/javascripts/discourse/app/components/topic-list/item.gjs b/app/assets/javascripts/discourse/app/components/topic-list/item.gjs
index 52113e435b9..3fd99b9f2ee 100644
--- a/app/assets/javascripts/discourse/app/components/topic-list/item.gjs
+++ b/app/assets/javascripts/discourse/app/components/topic-list/item.gjs
@@ -78,6 +78,7 @@ export default class Item extends Component {
return this.site.desktopView && this.args.focusLastVisitedTopic;
}
+ @action
navigateToTopic(topic, href) {
this.historyStore.set("lastTopicIdViewed", topic.id);
DiscourseURL.routeTo(href || topic.url);
@@ -232,6 +233,7 @@ export default class Item extends Component {
hideCategory=@hideCategory
tagsForUser=@tagsForUser
showTopicPostBadges=@showTopicPostBadges
+ navigateToTopic=this.navigateToTopic
}}
>
{{#if this.useMobileLayout}}