Merge pull request #1411 from albertgasset/MOBILE-2482

MOBILE-2482 core: Fix concurrent delegate handler updates
main
Juan Leyva 2018-07-12 11:22:34 +02:00 committed by GitHub
commit 5f614a5677
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -252,9 +252,8 @@ export class CoreDelegate {
this.updatePromises[siteId][handler.name] = promise.catch(() => { this.updatePromises[siteId][handler.name] = promise.catch(() => {
return false; return false;
}).then((enabled: boolean) => { }).then((enabled: boolean) => {
// Verify that this call is the last one that was started.
// Check that site hasn't changed since the check started. // Check that site hasn't changed since the check started.
if (this.isLastUpdateCall(time) && this.sitesProvider.getCurrentSiteId() === siteId) { if (this.sitesProvider.getCurrentSiteId() === siteId) {
if (enabled) { if (enabled) {
this.enabledHandlers[handler[this.handlerNameProperty]] = handler; this.enabledHandlers[handler[this.handlerNameProperty]] = handler;
} else { } else {