diff --git a/addons/mail/static/src/components/messaging_menu/messaging_menu.js b/addons/mail/static/src/components/messaging_menu/messaging_menu.js index 4e5ede8f635..a9a78521090 100644 --- a/addons/mail/static/src/components/messaging_menu/messaging_menu.js +++ b/addons/mail/static/src/components/messaging_menu/messaging_menu.js @@ -111,12 +111,6 @@ class MessagingMenu extends Component { */ return; } - // in mobile: keeps the messaging menu open in background - // TODO: maybe need to move this to a mobile component? - // task-2089887 - if (this.env.messaging.device.isMobile) { - return; - } // ignore click inside the menu if (this.el.contains(ev.target)) { return; diff --git a/addons/mail/static/src/models/chat_window/chat_window.js b/addons/mail/static/src/models/chat_window/chat_window.js index 4d51d952696..4bb1fe2442b 100644 --- a/addons/mail/static/src/models/chat_window/chat_window.js +++ b/addons/mail/static/src/models/chat_window/chat_window.js @@ -50,6 +50,13 @@ function factory(dependencies) { if (thread && notifyServer) { thread.notifyFoldStateToServer('closed'); } + if (this.env.device.isMobile && !this.env.messaging.discuss.isOpen) { + // If we are in mobile and discuss is not open, it means the + // chat window was opened from the messaging menu. In that + // case it should be re-opened to simulate it was always + // there in the background. + this.env.messaging.messagingMenu.update({ isOpen: true }); + } } expand() { diff --git a/addons/mail/static/src/models/messaging_menu/messaging_menu.js b/addons/mail/static/src/models/messaging_menu/messaging_menu.js index 654efa4b828..60212930d0f 100644 --- a/addons/mail/static/src/models/messaging_menu/messaging_menu.js +++ b/addons/mail/static/src/models/messaging_menu/messaging_menu.js @@ -16,11 +16,7 @@ function factory(dependencies) { * Close the messaging menu. Should reset its internal state. */ close() { - this.update({ - activeTabId: 'all', - isMobileNewMessageToggled: false, - isOpen: false, - }); + this.update({ isOpen: false }); } /**