Merge pull request #3285 from crazyserver/MOBILE-4079
MOBILE-4079 sites: Add missing awaits while adding a new sitemain
commit
d121fa2a2d
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue