diff options
Diffstat (limited to 'addons/mail/static/src/models/thread_cache')
| -rw-r--r-- | addons/mail/static/src/models/thread_cache/thread_cache.js | 10 |
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 |
