MOBILE-3833 core: Fix page loaded when switch account
parent
1211bf1c03
commit
5e0a46aa75
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue