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

This commit is contained in:
David Taylor 2023-12-01 16:01:59 +00:00 committed by GitHub
parent 9f9c82ea97
commit d636ff216a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import withChatChannel from "./chat-channel-decorator";
@withChatChannel @withChatChannel
export default class ChatChannelRoute extends DiscourseRoute { export default class ChatChannelRoute extends DiscourseRoute {
@service site; @service site;
@service router;
redirect(model) { redirect(model) {
if (this.site.mobileView) { if (this.site.mobileView) {
@ -15,7 +16,7 @@ export default class ChatChannelRoute extends DiscourseRoute {
const threadId = this.paramsFor("chat.channel.thread").threadId; const threadId = this.paramsFor("chat.channel.thread").threadId;
if (!messageId && !threadId && model.threadsManager.unreadThreadCount > 0) { if (!messageId && !threadId && model.threadsManager.unreadThreadCount > 0) {
this.transitionTo("chat.channel.threads", ...model.routeModels); this.router.transitionTo("chat.channel.threads", ...model.routeModels);
} }
} }
} }