diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-composer.js b/plugins/chat/assets/javascripts/discourse/components/chat-composer.js index 86142c3bc4b..77875c8ce6c 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-composer.js +++ b/plugins/chat/assets/javascripts/discourse/components/chat-composer.js @@ -184,7 +184,7 @@ export default class ChatComposer extends Component { this.currentMessage.uploads = cloneJSON(uploads); } - this.textareaInteractor.focus(); + this.textareaInteractor?.focus(); this.reportReplyingPresence(); this.persistDraft(); } @@ -212,6 +212,10 @@ export default class ChatComposer extends Component { } reportReplyingPresence() { + if (!this.args.channel) { + return; + } + if (this.args.channel.isDraft) { return; }