From 7e4a8c03f17d685f5d4baf7d96a83b55fefcdab8 Mon Sep 17 00:00:00 2001 From: dbh Date: Fri, 2 Feb 2018 16:03:58 +0530 Subject: [PATCH] [FIX] mail: correct chat window dropdown unread counter + hidden state Revision on recent JS refactoring: https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498 Intermediary changes have not been updated with final way of communicating with JS services. In particular, widgets must now explicitly call the service with this.call instead of relying on a mixin that hides the service call (e.g. the chat_mixin that has been removed) --- addons/mail/static/src/js/services/chat_manager.js | 2 +- addons/mail/static/src/js/services/chat_window_manager.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/mail/static/src/js/services/chat_manager.js b/addons/mail/static/src/js/services/chat_manager.js index 2655a07b55b..a58de02365a 100644 --- a/addons/mail/static/src/js/services/chat_manager.js +++ b/addons/mail/static/src/js/services/chat_manager.js @@ -1634,7 +1634,7 @@ var ChatManager = AbstractService.extend({ web_client.set_title_part("_chat", tabTitle); } - this._sendNotification(web_client, title, content); + this.call('bus_service', 'sendNotification', web_client, title, content); }, /** * Removes channel diff --git a/addons/mail/static/src/js/services/chat_window_manager.js b/addons/mail/static/src/js/services/chat_window_manager.js index bab6fbf7729..bea6eaf0ace 100644 --- a/addons/mail/static/src/js/services/chat_window_manager.js +++ b/addons/mail/static/src/js/services/chat_window_manager.js @@ -387,8 +387,8 @@ var ChatWindowManager = AbstractService.extend({ this.displayState.hiddenSessions = hiddenSessions; this.displayState.hiddenUnreadCounter = hiddenUnreadCounter; - if (this.displayState.$hidden_windows_dropdown) { - this.displayState.$hidden_windows_dropdown.remove(); + if (this.displayState.$hiddenWindowsDropdown) { + this.displayState.$hiddenWindowsDropdown.remove(); } if (hiddenSessions.length) { this.displayState.$hiddenWindowsDropdown = this._renderHiddenSessionsDropdown(); @@ -487,8 +487,8 @@ var ChatWindowManager = AbstractService.extend({ self.displayState.hiddenUnreadCounter += session.window.unread_msgs; } }); - if (self.displayState.$hidden_windows_dropdown) { - self.displayState.$hidden_windows_dropdown.html(self.renderHiddenSessionsDropdown().html()); + if (self.displayState.$hiddenWindowsDropdown) { + self.displayState.$hiddenWindowsDropdown.html(self._renderHiddenSessionsDropdown().html()); self._repositionHiddenSessionsDropdown(); } },