summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/components/thread_icon
diff options
context:
space:
mode:
authorSébastien Theys <seb@odoo.com>2021-01-18 16:49:01 +0000
committerSébastien Theys <seb@odoo.com>2021-01-18 16:59:02 +0000
commite995f03a9a55280b1e9173223cdfa619ae164cc3 (patch)
tree3aefcd4e4621f11cc971a652d7ed6f01a70765c0 /addons/mail/static/src/components/thread_icon
parent20d6efa817a4d839777c81d403bb8770807e784a (diff)
[FIX] mail, im_livechat, snailmail: use findFromIdentifyingData
find is O(n) and findFromIdentifyingData is O(1) task-2440693 closes odoo/odoo#64712 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/components/thread_icon')
-rw-r--r--addons/mail/static/src/components/thread_icon/thread_icon_tests.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/mail/static/src/components/thread_icon/thread_icon_tests.js b/addons/mail/static/src/components/thread_icon/thread_icon_tests.js
index 21966cc206f..d233d6f88a8 100644
--- a/addons/mail/static/src/components/thread_icon/thread_icon_tests.js
+++ b/addons/mail/static/src/components/thread_icon/thread_icon_tests.js
@@ -54,10 +54,10 @@ QUnit.test('chat: correspondent is typing', async function (assert) {
members: [this.data.currentPartnerId, 17],
});
await this.start();
- const thread = this.env.models['mail.thread'].find(thread =>
- thread.id === 20 &&
- thread.model === 'mail.channel'
- );
+ const thread = this.env.models['mail.thread'].findFromIdentifyingData({
+ id: 20,
+ model: 'mail.channel',
+ });
await this.createThreadIcon(thread);
assert.containsOnce(