summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models/thread_cache/thread_cache.js
diff options
context:
space:
mode:
authorXavier Dubuc <xdu@odoo.com>2020-11-02 14:13:22 +0000
committerXavier Dubuc <xdu@odoo.com>2020-11-05 09:27:03 +0000
commita4c737eb1d45610f6ab70268d5134dc5ed00ba8d (patch)
tree3679926bfead3e18e31ba06e49a4f4e365ec4dee /addons/mail/static/src/models/thread_cache/thread_cache.js
parent5dfd793470deed9ab459ccb2d747511213bc5bf9 (diff)
[FIX] mail: prevent load messages if already loading
task-2373952 closes odoo/odoo#61172 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Diffstat (limited to 'addons/mail/static/src/models/thread_cache/thread_cache.js')
-rw-r--r--addons/mail/static/src/models/thread_cache/thread_cache.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/addons/mail/static/src/models/thread_cache/thread_cache.js b/addons/mail/static/src/models/thread_cache/thread_cache.js
index c474c565219..c684861e2be 100644
--- a/addons/mail/static/src/models/thread_cache/thread_cache.js
+++ b/addons/mail/static/src/models/thread_cache/thread_cache.js
@@ -203,13 +203,17 @@ function factory(dependencies) {
if (!wasCacheRefreshRequested && this.threadViews.length === 0) {
// don't load message that won't be used
return false;
- }
- if (!wasCacheRefreshRequested && (this.isLoaded || this.isLoading)) {
+ }
+ if (this.isLoading) {
+ // avoid duplicate RPC
+ return false;
+ }
+ if (!wasCacheRefreshRequested && this.isLoaded) {
// avoid duplicate RPC
return false;
}
const isMainCache = this.thread.mainCache === this;
- if (isMainCache && (this.isLoaded || this.isLoading)) {
+ if (isMainCache && this.isLoaded) {
// Ignore request on the main cache if it is already loaded or
// loading. Indeed the main cache is automatically sync with
// server updates already, so there is never a need to refresh