diff options
| author | Ipsita Borisagar <ibo@odoo.com> | 2021-02-09 04:48:29 +0000 |
|---|---|---|
| committer | Ipsita Borisagar <ibo@odoo.com> | 2021-02-15 05:11:19 +0000 |
| commit | ff44dbf31a3732a8ebced7ff907fff3b2440afc4 (patch) | |
| tree | e74a602dedaa285b59a30b27a4278f4cf3e84f37 /addons/mail/static/src/models/thread | |
| parent | b13fc817d150f642254c4738cfbd91ac2ecaa65f (diff) | |
[FIX] mail: prevent message separator for new conversations
Before this commit:
When a new conversation is initiated, the 'new messages' separator is displayed.
This looks a bit weird as there is no history of conversation and thus no older
messages from which new messages should be separated.
After this commit:
The 'new messages' separator will not be displayed in new conversations.
LINKS
PR https://github.com/odoo/odoo/pull/65952
Task-2453511
closes odoo/odoo#65952
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Diffstat (limited to 'addons/mail/static/src/models/thread')
| -rw-r--r-- | addons/mail/static/src/models/thread/thread.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/mail/static/src/models/thread/thread.js b/addons/mail/static/src/models/thread/thread.js index 31339e063f3..4739e59f91e 100644 --- a/addons/mail/static/src/models/thread/thread.js +++ b/addons/mail/static/src/models/thread/thread.js @@ -1344,6 +1344,9 @@ function factory(dependencies) { const index = this.orderedMessages.findIndex(message => message.id === this.lastSeenByCurrentPartnerMessageId ); + if (index === -1) { + return [['unlink']]; + } const message = this.orderedMessages[index + 1]; if (!message) { return [['unlink']]; |
