From 4a693c0233d3fbfdc991e2ccbfcbcd2d360ce788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Mon, 7 Sep 2020 09:26:38 +0000 Subject: [FIX] im_livechat, mail, website_livechat: invite button in livechats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-2334724 closes odoo/odoo#57505 X-original-commit: 5316c91c27e48bfaa3ebf3fb97e35220fabc986e Signed-off-by: Sébastien Theys (seb) Signed-off-by: Alexandre Kühn (aku) --- addons/mail/static/src/widgets/discuss/discuss.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'addons/mail/static/src/widgets') diff --git a/addons/mail/static/src/widgets/discuss/discuss.js b/addons/mail/static/src/widgets/discuss/discuss.js index 53ed2f73b00..ac1eea69bf0 100644 --- a/addons/mail/static/src/widgets/discuss/discuss.js +++ b/addons/mail/static/src/widgets/discuss/discuss.js @@ -162,6 +162,16 @@ const DiscussWidget = AbstractAction.extend({ active_id: this.discuss.activeId, }); }, + /** + * @private + * @returns {boolean} + */ + _shouldHaveInviteButton() { + return ( + this.discuss.thread && + this.discuss.thread.channel_type === 'channel' + ); + }, /** * @private */ @@ -176,10 +186,7 @@ const DiscussWidget = AbstractAction.extend({ */ _updateControlPanel() { // Invite - if ( - this.discuss.thread && - this.discuss.thread.channel_type === 'channel' - ) { + if (this._shouldHaveInviteButton()) { this.$buttons.find('.o_invite').removeClass('o_hidden'); } else { this.$buttons.find('.o_invite').addClass('o_hidden'); -- cgit v1.2.3