MOBILE-2795 core: Select first site in site picker if no current

main
Dani Palou 2019-01-10 13:30:18 +01:00
parent 971aebd658
commit e77916a9bb
1 changed files with 6 additions and 0 deletions

View File

@ -57,6 +57,12 @@ export class CoreSitePickerComponent implements OnInit {
}));
});
if (!this.selectedSite && sites.length) {
// There is no current site, select the first one.
this.selectedSite = sites[0].id;
this.siteSelected.emit(this.selectedSite);
}
return Promise.all(promises).then(() => {
this.sites = sites;
});