summaryrefslogtreecommitdiff
path: root/addons/im_livechat
diff options
context:
space:
mode:
authorSébastien Theys <seb@odoo.com>2021-01-21 17:43:49 +0000
committerSébastien Theys <seb@odoo.com>2021-01-21 17:43:49 +0000
commit7f9af5747c7b650b6cf4ab894bdd0b113e77a78b (patch)
tree5152dca1d14355e7c7465b41fcbe9c80770e98a6 /addons/im_livechat
parent47bfdf0592a5dd93870ca1a9da326351d70087bb (diff)
[FIX] mail, *: significantly reduce number of useless renders
* = hr_holidays, im_livechat, website_livechat A huge amount of components where rendered for no reason, notably when typing a new message (at every key press), which significantly slowed down the interface. There were 2 causes to this number of renders: - OWL rendering all children automatically, even if their props didn't change, unless `shouldUpdate` is overridden, which is now done. - `useStore` selectors being way too generous in what they observed task-2399731 closes odoo/odoo#62703 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/im_livechat')
-rw-r--r--addons/im_livechat/static/src/components/discuss_sidebar/discuss_sidebar.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/addons/im_livechat/static/src/components/discuss_sidebar/discuss_sidebar.js b/addons/im_livechat/static/src/components/discuss_sidebar/discuss_sidebar.js
index 2dafeed4c79..35070cb8e6d 100644
--- a/addons/im_livechat/static/src/components/discuss_sidebar/discuss_sidebar.js
+++ b/addons/im_livechat/static/src/components/discuss_sidebar/discuss_sidebar.js
@@ -69,15 +69,8 @@ patch(components.DiscussSidebar, 'im_livechat/static/src/components/discuss_side
*/
_useStoreSelector(props) {
return Object.assign(this._super(...arguments), {
- allOrderedAndPinnedLivechats: this.env.models['mail.thread']
- .all(thread =>
- thread.channel_type === 'livechat' &&
- thread.isPinned &&
- thread.model === 'mail.channel'
- )
- .map(livechat => livechat.__state),
- }
- );
+ allOrderedAndPinnedLivechats: this.quickSearchOrderedAndPinnedLivechatList(),
+ });
},
});