Merge pull request #3285 from crazyserver/MOBILE-4079

MOBILE-4079 sites: Add missing awaits while adding a new site
main
Dani Palou 2022-05-19 07:53:41 +02:00 committed by GitHub
commit d121fa2a2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -557,14 +557,14 @@ export class CoreSitesProvider {
} }
// Add site to sites list. // 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; this.sites[siteId] = candidateSite;
if (login) { if (login) {
// Turn candidate site into current site. // Turn candidate site into current site.
this.currentSite = candidateSite; this.currentSite = candidateSite;
// Store session. // Store session.
this.login(siteId); await this.login(siteId);
} else if (this.currentSite && this.currentSite.getId() == siteId) { } else if (this.currentSite && this.currentSite.getId() == siteId) {
// Current site has just been updated, trigger the event. // Current site has just been updated, trigger the event.
CoreEvents.trigger(CoreEvents.SITE_UPDATED, info, siteId); CoreEvents.trigger(CoreEvents.SITE_UPDATED, info, siteId);