MOBILE-3833 core: Fix page loaded when switch account

main
Dani Palou 2022-03-18 10:15:48 +01:00
parent 1211bf1c03
commit 5e0a46aa75
2 changed files with 9 additions and 3 deletions

View File

@ -55,11 +55,15 @@ export class CoreRedirectGuard implements CanLoad, CanActivate {
// Redirect to site path.
if (redirect.siteId && redirect.siteId !== CoreConstants.NO_SITE_ID) {
const redirectData: CoreRedirectPayload = {
redirectPath: redirect.redirectPath,
redirectOptions: redirect.redirectOptions,
urlToOpen: redirect.urlToOpen,
};
if (redirect.redirectPath !== 'main') {
// Only pass redirect path if the page to load isn't the main menu.
redirectData.redirectPath = redirect.redirectPath;
redirectData.redirectOptions = redirect.redirectOptions;
}
const loggedIn = await CoreSites.loadSite(
redirect.siteId,
redirectData,

View File

@ -182,7 +182,9 @@ export class CoreNavigatorService {
* @return Whether navigation suceeded.
*/
async navigateToSiteHome(options: Omit<CoreNavigationOptions, 'reset'> & { siteId?: string } = {}): Promise<boolean> {
const landingPagePath = this.getLandingTabPage();
const siteId = options.siteId ?? CoreSites.getCurrentSiteId();
const landingPagePath = CoreSites.isLoggedIn() && CoreSites.getCurrentSiteId() === siteId ?
this.getLandingTabPage() : 'main';
return this.navigateToSitePath(landingPagePath, {
...options,