diff options
| author | Sébastien Theys <seb@odoo.com> | 2021-01-15 17:47:01 +0000 |
|---|---|---|
| committer | Sébastien Theys <seb@odoo.com> | 2021-01-15 17:47:01 +0000 |
| commit | fd46b3dcfd0a2419839f9b3a40b30c76538e0099 (patch) | |
| tree | 7c01ea93df95a3ba06aacaebb8701ba8ba40812e /addons/mail/static/src/components/chat_window/chat_window.js | |
| parent | 0d9a782681fcbd50ca687ae3158dc12f5b3571cb (diff) | |
[FIX] mail, sms: restore mobile app back button handlers
task-2347640
closes odoo/odoo#63313
Related: odoo/enterprise#15320
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/components/chat_window/chat_window.js')
| -rw-r--r-- | addons/mail/static/src/components/chat_window/chat_window.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/addons/mail/static/src/components/chat_window/chat_window.js b/addons/mail/static/src/components/chat_window/chat_window.js index 27d6bb68b68..8ae13de6d92 100644 --- a/addons/mail/static/src/components/chat_window/chat_window.js +++ b/addons/mail/static/src/components/chat_window/chat_window.js @@ -10,6 +10,8 @@ const useStore = require('mail/static/src/component_hooks/use_store/use_store.js const useUpdate = require('mail/static/src/component_hooks/use_update/use_update.js'); const { isEventHandled } = require('mail/static/src/utils/utils.js'); +const patchMixin = require('web.patchMixin'); + const { Component } = owl; const { useRef } = owl.hooks; @@ -49,19 +51,27 @@ class ChatWindow extends Component { * it has one! */ this._threadRef = useRef('thread'); + this._onWillHideHomeMenu = this._onWillHideHomeMenu.bind(this); + this._onWillShowHomeMenu = this._onWillShowHomeMenu.bind(this); // the following are passed as props to children this._onAutocompleteSelect = this._onAutocompleteSelect.bind(this); this._onAutocompleteSource = this._onAutocompleteSource.bind(this); + this._constructor(...args); } + /** + * Allows patching constructor. + */ + _constructor() {} + mounted() { - this.env.messagingBus.on('will_hide_home_menu', this, this._onWillHideHomeMenu.bind(this)); - this.env.messagingBus.on('will_show_home_menu', this, this._onWillShowHomeMenu.bind(this)); + this.env.messagingBus.on('will_hide_home_menu', this, this._onWillHideHomeMenu); + this.env.messagingBus.on('will_show_home_menu', this, this._onWillShowHomeMenu); } willUnmount() { - this.env.messagingBus.off('will_hide_home_menu', this, this._onWillHideHomeMenu.bind(this)); - this.env.messagingBus.off('will_show_home_menu', this, this._onWillShowHomeMenu.bind(this)); + this.env.messagingBus.off('will_hide_home_menu', this, this._onWillHideHomeMenu); + this.env.messagingBus.off('will_show_home_menu', this, this._onWillShowHomeMenu); } //-------------------------------------------------------------------------- @@ -343,6 +353,6 @@ Object.assign(ChatWindow, { template: 'mail.ChatWindow', }); -return ChatWindow; +return patchMixin(ChatWindow); }); |
