summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models/thread_view/thread_view.js
diff options
context:
space:
mode:
authorSébastien Theys <seb@odoo.com>2020-09-29 18:50:23 +0000
committerSébastien Theys <seb@odoo.com>2020-09-29 19:47:12 +0000
commitfb9b1c8a169840951925fa810f71e865a54e3a31 (patch)
tree591c34b02dfdde95ebaf296db7abfee5614e22ea /addons/mail/static/src/models/thread_view/thread_view.js
parentb4783500db5b7c645859227e8be5cd55025b2882 (diff)
[FIX] mail: reintroduce auto scroll on receiving message
task-2336251 closes odoo/odoo#58867 X-original-commit: f732980b2e5e83bcf2fdc8d3ce756f256cacbd4f Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
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.js14
1 files changed, 12 insertions, 2 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 f2c64dabe2c..ee53e616b1c 100644
--- a/addons/mail/static/src/models/thread_view/thread_view.js
+++ b/addons/mail/static/src/models/thread_view/thread_view.js
@@ -47,8 +47,8 @@ function factory(dependencies) {
markComponentHintProcessed(hint) {
let filterFun;
switch (hint.type) {
- case 'current-partner-just-posted-message':
- filterFun = h => h.type !== hint.type && h.messageId !== hint.data.messageId;
+ case 'message-received':
+ filterFun = h => h.type !== hint.type && h.message !== hint.data.message;
break;
default:
filterFun = h => h.type !== hint.type;
@@ -57,6 +57,10 @@ function factory(dependencies) {
this.update({
componentHintList: this.componentHintList.filter(filterFun),
});
+ this.env.messagingBus.trigger('o-thread-view-hint-processed', {
+ hint,
+ threadViewer: this.threadViewer,
+ });
}
/**
@@ -197,6 +201,12 @@ function factory(dependencies) {
isPreparingLoading: attr({
default: false,
}),
+ /**
+ * Determines whether `this` should automatically scroll on receiving
+ * a new message. Detection of new message is done through the component
+ * hint `message-received`.
+ */
+ hasAutoScrollOnMessageReceived: attr(),
lastMessage: many2one('mail.message', {
related: 'thread.lastMessage',
}),