summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models/thread_view/thread_view.js
diff options
context:
space:
mode:
authorXavier Dubuc <xdu@odoo.com>2020-10-09 13:50:45 +0000
committerXavier Dubuc <xdu@odoo.com>2020-10-29 11:45:42 +0000
commitecb56a6893dd7b76402c2262fb93f8dea079fde0 (patch)
tree1dd18589fbdbbb1efbba2a300fddaaae5fb49385 /addons/mail/static/src/models/thread_view/thread_view.js
parent1525dc7e4481cf9e24e6c5fff9a73df874670c97 (diff)
[FIX] mail: fix handling of lastVisibleMessage in channel seen condition
also fix a problem with composer.hasFocus field not always correctly updated (e.g. when switching from a channel to another in discuss) task-2278915 closes odoo/odoo#60079 Signed-off-by: Alexandre Kühn (aku) <aku@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.js6
1 files changed, 5 insertions, 1 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 6e875133a4b..895732f8872 100644
--- a/addons/mail/static/src/models/thread_view/thread_view.js
+++ b/addons/mail/static/src/models/thread_view/thread_view.js
@@ -136,6 +136,7 @@ function factory(dependencies) {
if (this.threadCache) {
this.threadCache.update({ isCacheRefreshRequested: true });
}
+ this.update({ lastVisibleMessage: [['unlink']] });
}
/**
@@ -225,12 +226,15 @@ function factory(dependencies) {
* hint `message-received`.
*/
hasAutoScrollOnMessageReceived: attr(),
+ /**
+ * Last message in the context of the currently displayed thread cache.
+ */
lastMessage: many2one('mail.message', {
related: 'thread.lastMessage',
}),
/**
* Most recent message in this ThreadView that has been shown to the
- * current partner.
+ * current partner in the currently displayed thread cache.
*/
lastVisibleMessage: many2one('mail.message'),
messages: many2many('mail.message', {