diff options
| author | Sébastien Theys <seb@odoo.com> | 2021-01-21 17:43:49 +0000 |
|---|---|---|
| committer | Sébastien Theys <seb@odoo.com> | 2021-01-21 17:43:49 +0000 |
| commit | 7f9af5747c7b650b6cf4ab894bdd0b113e77a78b (patch) | |
| tree | 5152dca1d14355e7c7465b41fcbe9c80770e98a6 /addons/hr_holidays/static/src/components/thread_view/thread_view.js | |
| parent | 47bfdf0592a5dd93870ca1a9da326351d70087bb (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/hr_holidays/static/src/components/thread_view/thread_view.js')
| -rw-r--r-- | addons/hr_holidays/static/src/components/thread_view/thread_view.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/addons/hr_holidays/static/src/components/thread_view/thread_view.js b/addons/hr_holidays/static/src/components/thread_view/thread_view.js index c07ab2189a9..73ca28d4d0c 100644 --- a/addons/hr_holidays/static/src/components/thread_view/thread_view.js +++ b/addons/hr_holidays/static/src/components/thread_view/thread_view.js @@ -17,11 +17,10 @@ patch(components.ThreadView, 'hr_holidays/static/src/components/thread_view/thre */ _useStoreSelector(props) { const res = this._super(...arguments); - const threadView = this.env.models['mail.thread_view'].get(props.threadViewLocalId); - const thread = threadView ? threadView.thread : undefined; - const correspondent = thread ? thread.correspondent : undefined; + const thread = res.thread; + const correspondent = thread && thread.correspondent; return Object.assign({}, res, { - correspondent: correspondent ? correspondent.__state : undefined, + correspondentOutOfOfficeText: correspondent && correspondent.outOfOfficeText, }); }, }); |
