diff --git a/addons/mail/static/src/models/channel_command/channel_command.js b/addons/mail/static/src/models/channel_command/channel_command.js index 086cf9c234e..a098e3f3a14 100644 --- a/addons/mail/static/src/models/channel_command/channel_command.js +++ b/addons/mail/static/src/models/channel_command/channel_command.js @@ -96,14 +96,14 @@ function factory(dependencies) { * @static * @param {Object} param0 * @param {mail.thread} param0.channel - * @param {Object} [param0.postData={}] + * @param {Object} [param0.body=''] */ - async execute({ channel, postData = {} }) { + async execute({ channel, body = '' }) { return this.env.services.rpc({ model: 'mail.channel', method: this.methodName, args: [[channel.id]], - kwargs: postData, + kwargs: { body }, }); } diff --git a/addons/mail/static/src/models/composer/composer.js b/addons/mail/static/src/models/composer/composer.js index ad9079f4ec0..1109eba9cb3 100644 --- a/addons/mail/static/src/models/composer/composer.js +++ b/addons/mail/static/src/models/composer/composer.js @@ -206,7 +206,10 @@ function factory(dependencies) { if (this.thread.model === 'mail.channel') { const command = this._getCommandFromText(this.textInputContent); if (command) { - command.execute({ channel: this.thread, body: this.textInputContent }); + await command.execute({ channel: this.thread, body: this.textInputContent }); + if (this.exists()) { + this._reset(); + } return; } }