FEATURE: enable chat with dms only

This commit is contained in:
Gabriel Grubba 2024-07-12 11:21:29 -03:00
parent a553dd70c0
commit 1e9add4843
No known key found for this signature in database
GPG Key ID: 5FE41764F62D556C
2 changed files with 17 additions and 16 deletions

View File

@ -45,21 +45,22 @@ export default class ChatFooter extends Component {
<template>
{{#if this.shouldRenderFooter}}
<nav class="c-footer">
<DButton
@route="chat.channels"
@icon="comments"
@translatedLabel={{i18n "chat.channel_list.title"}}
aria-label={{i18n "chat.channel_list.aria_label"}}
id="c-footer-channels"
class={{concatClass
"btn-transparent"
"c-footer__item"
(if (eq this.currentRouteName "chat.channels") "--active")
}}
>
<UnreadChannelsIndicator />
</DButton>
{{#if this.siteSettings.chat_public_channels_enabled}}
<DButton
@route="chat.channels"
@icon="comments"
@translatedLabel={{i18n "chat.channel_list.title"}}
aria-label={{i18n "chat.channel_list.aria_label"}}
id="c-footer-channels"
class={{concatClass
"btn-transparent"
"c-footer__item"
(if (eq this.currentRouteName "chat.channels") "--active")
}}
>
<UnreadChannelsIndicator />
</DButton>
{{/if}}
{{#if this.directMessagesEnabled}}
<DButton
@route="chat.direct-messages"

View File

@ -48,7 +48,7 @@ export default class ChatIndexRoute extends DiscourseRoute {
// We are on desktop. Check for last visited channel and transition if so
const id = this.currentUser.custom_fields.last_chat_channel_id;
if (id) {
if (id /** && this.siteSettings.chat_public_channels_enabled **/) {
return this.chatChannelsManager.find(id).then((c) => {
return this.router.replaceWith("chat.channel", ...c.routeModels);
});