diff --git a/src/domain/session/room/ComposerViewModel.js b/src/domain/session/room/ComposerViewModel.js index 3ee7f8e3..240e7d4c 100644 --- a/src/domain/session/room/ComposerViewModel.js +++ b/src/domain/session/room/ComposerViewModel.js @@ -47,8 +47,8 @@ export class ComposerViewModel extends ViewModel { return this._roomVM.isEncrypted; } - sendMessage(message) { - const success = this._roomVM._sendMessage(message, this._replyVM); + async sendMessage(message) { + const success = await this._roomVM._sendMessage(message, this._replyVM); if (success) { this._isEmpty = true; this.emitChange("canSend"); diff --git a/src/platform/web/ui/session/room/MessageComposer.js b/src/platform/web/ui/session/room/MessageComposer.js index 20fd3659..5a6ba593 100644 --- a/src/platform/web/ui/session/room/MessageComposer.js +++ b/src/platform/web/ui/session/room/MessageComposer.js @@ -69,9 +69,9 @@ export class MessageComposer extends TemplateView { this.value.clearReplyingTo(); } - _trySend() { + async _trySend() { this._input.focus(); - if (this.value.sendMessage(this._input.value)) { + if (await this.value.sendMessage(this._input.value)) { this._input.value = ""; } }