discourse-ai/assets/javascripts/discourse/routes/preferences-ai.js

16 lines
476 B
JavaScript
Raw Normal View History

2024-05-27 13:49:24 -04:00
import { service } from "@ember/service";
import { defaultHomepage } from "discourse/lib/utilities";
import RestrictedUserRoute from "discourse/routes/restricted-user";
export default class PreferencesAiRoute extends RestrictedUserRoute {
@service siteSettings;
setupController(controller, user) {
if (!this.siteSettings.discourse_ai_enabled) {
return this.router.transitionTo(`discovery.${defaultHomepage()}`);
}
controller.set("model", user);
}
}