MOBILE-4079 sites: Add missing awaits while adding a new site

main
Pau Ferrer Ocaña 2022-05-18 17:21:38 +02:00
parent a5d06e20ea
commit cb49f03fc4
1 changed files with 2 additions and 2 deletions

View File

@ -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);