This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/plugins/chat/assets/javascripts/discourse/controllers/chat.js
Alan Guo Xiang Tan fde9e6bc25
DEV: Migrate sidebar site settings (#19336)
This new site setting replaces the
`enable_experimental_sidebar_hamburger` and `enable_sidebar` site
settings as the sidebar feature exits the experimental phase.

Note that we're replacing this without depreciation since the previous
site setting was considered experimental.

Internal Ref: /t/86563
2022-12-08 09:44:29 +08:00

23 lines
445 B
JavaScript

import Controller from "@ember/controller";
import { inject as service } from "@ember/service";
export default class ChatController extends Controller {
@service chat;
get shouldUseChatSidebar() {
if (this.site.mobileView) {
return false;
}
if (this.shouldUseCoreSidebar) {
return false;
}
return true;
}
get shouldUseCoreSidebar() {
return this.siteSettings.navigation_menu === "sidebar";
}
}