Skip to content

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

DEV: Resolve transitionTo deprecation in chat-channel route (#24668)

David Taylord636ff216ad9
diff --git a/plugins/chat/assets/javascripts/discourse/routes/chat-channel.js b/plugins/chat/assets/javascripts/discourse/routes/chat-channel.js
index e18f3f17692..2b282350dfb 100644
--- a/plugins/chat/assets/javascripts/discourse/routes/chat-channel.js
+++ b/plugins/chat/assets/javascripts/discourse/routes/chat-channel.js
@@ -5,6 +5,7 @@ import withChatChannel from "./chat-channel-decorator";
@withChatChannel
export default class ChatChannelRoute extends DiscourseRoute {
@service site;
+ @service router;
redirect(model) {
if (this.site.mobileView) {
@@ -15,7 +16,7 @@ export default class ChatChannelRoute extends DiscourseRoute {
const threadId = this.paramsFor("chat.channel.thread").threadId;
if (!messageId && !threadId && model.threadsManager.unreadThreadCount > 0) {
- this.transitionTo("chat.channel.threads", ...model.routeModels);
+ this.router.transitionTo("chat.channel.threads", ...model.routeModels);
}
}
}