mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
24 lines
571 B
JavaScript
24 lines
571 B
JavaScript
import { service } from "@ember/service";
|
|
import { defaultHomepage } from "discourse/lib/utilities";
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
|
|
|
export default class ChatBrowseIndexRoute extends DiscourseRoute {
|
|
@service chat;
|
|
@service siteSettings;
|
|
@service router;
|
|
|
|
beforeModel() {
|
|
if (!this.siteSettings.enable_public_channels) {
|
|
return this.router.transitionTo(`discovery.${defaultHomepage()}`);
|
|
}
|
|
}
|
|
|
|
activate() {
|
|
this.chat.activeChannel = null;
|
|
}
|
|
|
|
afterModel() {
|
|
this.router.replaceWith("chat.browse.open");
|
|
}
|
|
}
|