summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/components/composer/composer.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/mail/static/src/components/composer/composer.js')
-rw-r--r--addons/mail/static/src/components/composer/composer.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/addons/mail/static/src/components/composer/composer.js b/addons/mail/static/src/components/composer/composer.js
index 5c3968a0fae..afb7d811eae 100644
--- a/addons/mail/static/src/components/composer/composer.js
+++ b/addons/mail/static/src/components/composer/composer.js
@@ -175,9 +175,21 @@ class Composer extends Component {
/**
* Post a message in the composer on related thread.
*
+ * Posting of the message could be aborted if it cannot be posted like if there are attachments
+ * currently uploading or if there is no text content and no attachments.
+ *
* @private
*/
async _postMessage() {
+ if (!this.composer.canPostMessage) {
+ if (this.composer.hasUploadingAttachment) {
+ this.env.services['notification'].notify({
+ message: this.env._t("Please wait while the file is uploading."),
+ type: 'warning',
+ });
+ }
+ return;
+ }
// TODO: take suggested recipients into account (task-2283356)
await this.composer.postMessage();
// TODO: we might need to remove trigger and use the store to wait for the post rpc to be done
@@ -246,9 +258,6 @@ class Composer extends Component {
* @private
*/
_onClickSend() {
- if (!this.composer.canPostMessage) {
- return;
- }
this._postMessage();
}
@@ -335,9 +344,6 @@ class Composer extends Component {
* @private
*/
_onTextInputKeydownEnter() {
- if (!this.composer.canPostMessage) {
- return;
- }
this._postMessage();
}