diff --git a/addons/mail/static/src/components/composer/composer.js b/addons/mail/static/src/components/composer/composer.js index 10dc3a8ecf56de7d8b772a56e01b512cefd2125b..6d2a6ff26b4d47c0979341eee374c29c8fd3a789 100644 --- a/addons/mail/static/src/components/composer/composer.js +++ b/addons/mail/static/src/components/composer/composer.js @@ -34,23 +34,6 @@ export class Composer extends Component { return this.messaging && this.messaging.models['ComposerView'].get(this.props.localId); } - /** - * Determine whether composer should display a footer. - * - * @returns {boolean} - */ - get hasFooter() { - if (!this.composerView) { - return false; - } - return ( - this.composerView.hasThreadTyping || - this.composerView.composer.attachments.length > 0 || - this.composerView.messageViewInEditing || - !this.composerView.isCompact - ); - } - /** * Determine whether the composer should display a header. * diff --git a/addons/mail/static/src/components/composer/composer.xml b/addons/mail/static/src/components/composer/composer.xml index 29adb931388df76c8d0d4a01c1f731920588bad5..4406e5f7c4b98972c4283b5b1e2cd73dfa65bec2 100644 --- a/addons/mail/static/src/components/composer/composer.xml +++ b/addons/mail/static/src/components/composer/composer.xml @@ -6,7 +6,7 @@ t-att-class="{ 'o-focused': composerView and composerView.isFocused, 'o-has-current-partner-avatar': props.hasCurrentPartnerAvatar, - 'o-has-footer': hasFooter, + 'o-has-footer': composerView and composerView.hasFooter, 'o-has-header': hasHeader, 'o-is-in-thread-view': composerView and composerView.threadView, 'o-is-compact': composerView and composerView.isCompact, @@ -116,7 +116,7 @@ </t> </div> </div> - <t t-if="hasFooter"> + <t t-if="composerView.hasFooter"> <div class="o_Composer_coreFooter" t-att-class="{ 'o-composer-is-compact': composerView.isCompact }"> <t t-if="composerView.hasThreadTyping"> <ThreadTextualTypingStatus className="'o_Composer_threadTextualTypingStatus'" threadLocalId="composerView.composer.activeThread.localId"/> diff --git a/addons/mail/static/src/models/composer_view.js b/addons/mail/static/src/models/composer_view.js index 420f4a4cff64cf1ac78cc12dd9fd6d62a88d5168..d3eac29b7d5aec153257836d19727599e9c81272 100644 --- a/addons/mail/static/src/models/composer_view.js +++ b/addons/mail/static/src/models/composer_view.js @@ -577,6 +577,18 @@ registerModel({ } return clear(); }, + /** + * @private + * @returns {boolean} + */ + _computeHasFooter() { + return Boolean( + this.hasThreadTyping || + this.composer.attachments.length > 0 || + this.messageViewInEditing || + !this.isCompact + ); + }, /** * @private * @return {boolean} @@ -1035,6 +1047,12 @@ registerModel({ compute: '_computeHasFollowers', default: false, }), + /** + * Determines whether composer should display a footer. + */ + hasFooter: attr({ + compute: '_computeHasFooter', + }), /** * States whether there is any result currently found for the current * suggestion delimiter and search term, if applicable.