diff --git a/src/core/guards/redirect.ts b/src/core/guards/redirect.ts index e8dc44e78..da7c11a3e 100644 --- a/src/core/guards/redirect.ts +++ b/src/core/guards/redirect.ts @@ -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, diff --git a/src/core/services/navigator.ts b/src/core/services/navigator.ts index 88e012094..e2613e579 100644 --- a/src/core/services/navigator.ts +++ b/src/core/services/navigator.ts @@ -182,7 +182,9 @@ export class CoreNavigatorService { * @return Whether navigation suceeded. */ async navigateToSiteHome(options: Omit & { siteId?: string } = {}): Promise { - 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,