MOBILE-3846 core: Fix redirect to a NO_SITE page

main
Dani Palou 2021-08-25 12:45:34 +02:00
parent 9c3251ec1d
commit 83d5282852
2 changed files with 9 additions and 13 deletions

View File

@ -76,11 +76,7 @@ export class CoreRedirectGuard implements CanLoad, CanActivate {
// Redirect to non-site path.
const route = Router.parseUrl(redirect.page);
route.queryParams = {
redirectPath: redirect.page,
redirectOptions: redirect.options,
} as CoreRedirectPayload;
route.queryParams = redirect.options?.params || {};
return route;
}

View File

@ -201,14 +201,6 @@ export class CoreNavigatorService {
const siteId = options.siteId ?? CoreSites.getCurrentSiteId();
const navigationOptions: CoreNavigationOptions = CoreObject.without(options, ['siteId']);
// If the path doesn't belong to a site, call standard navigation.
if (siteId === CoreConstants.NO_SITE_ID) {
return this.navigate(path, {
...navigationOptions,
reset: true,
});
}
// If we are logged into a different site, log out first.
if (CoreSites.isLoggedIn() && CoreSites.getCurrentSiteId() !== siteId) {
if (CoreSitePlugins.hasSitePluginsLoaded) {
@ -223,6 +215,14 @@ export class CoreNavigatorService {
await CoreSites.logout();
}
// If the path doesn't belong to a site, call standard navigation.
if (siteId === CoreConstants.NO_SITE_ID) {
return this.navigate(path, {
...navigationOptions,
reset: true,
});
}
// If we are not logged into the site, load the site.
if (!CoreSites.isLoggedIn()) {
const modal = await CoreDomUtils.showModalLoading();