[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)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user