From cb49f03fc4826121f58816bb81a1b8f1fc47e7d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 18 May 2022 17:21:38 +0200 Subject: [PATCH] MOBILE-4079 sites: Add missing awaits while adding a new site --- src/core/services/sites.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/services/sites.ts b/src/core/services/sites.ts index 64c5af804..9cddd8b96 100644 --- a/src/core/services/sites.ts +++ b/src/core/services/sites.ts @@ -557,14 +557,14 @@ export class CoreSitesProvider { } // Add site to sites list. - this.addSite(siteId, siteUrl, token, info, privateToken, config, oauthId); + await this.addSite(siteId, siteUrl, token, info, privateToken, config, oauthId); this.sites[siteId] = candidateSite; if (login) { // Turn candidate site into current site. this.currentSite = candidateSite; // Store session. - this.login(siteId); + await this.login(siteId); } else if (this.currentSite && this.currentSite.getId() == siteId) { // Current site has just been updated, trigger the event. CoreEvents.trigger(CoreEvents.SITE_UPDATED, info, siteId);