diff options
Diffstat (limited to 'addons/mail/static/src/models/thread_view/thread_view.js')
| -rw-r--r-- | addons/mail/static/src/models/thread_view/thread_view.js | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/addons/mail/static/src/models/thread_view/thread_view.js b/addons/mail/static/src/models/thread_view/thread_view.js index 5c65e19c0f8..bf4560998bd 100644 --- a/addons/mail/static/src/models/thread_view/thread_view.js +++ b/addons/mail/static/src/models/thread_view/thread_view.js @@ -45,17 +45,8 @@ function factory(dependencies) { * @param {Object} hint */ markComponentHintProcessed(hint) { - let filterFun; - switch (hint.type) { - case 'message-received': - filterFun = h => h.type !== hint.type && h.message !== hint.data.message; - break; - default: - filterFun = h => h.type !== hint.type; - break; - } this.update({ - componentHintList: this.componentHintList.filter(filterFun), + componentHintList: this.componentHintList.filter(h => h !== hint), }); this.env.messagingBus.trigger('o-thread-view-hint-processed', { hint, @@ -143,6 +134,8 @@ function factory(dependencies) { * @private */ _onThreadCacheChanged() { + // clear obsolete hints + this.update({ componentHintList: clear() }); this.addComponentHint('change-of-thread-cache'); if (this.threadCache) { this.threadCache.update({ isCacheRefreshRequested: true }); @@ -236,7 +229,9 @@ function factory(dependencies) { * a new message. Detection of new message is done through the component * hint `message-received`. */ - hasAutoScrollOnMessageReceived: attr(), + hasAutoScrollOnMessageReceived: attr({ + default: true, + }), /** * Last message in the context of the currently displayed thread cache. */ |
