MOBILE-3320 navigation: Review pending TODOs
parent
e2987a44b7
commit
4b2b1c1e3e
|
@ -261,7 +261,6 @@ export class CoreLoginCredentialsPage implements OnInit, OnDestroy {
|
||||||
|
|
||||||
this.siteId = id;
|
this.siteId = id;
|
||||||
|
|
||||||
// @todo test that this is working properly.
|
|
||||||
await CoreNavigator.navigateToSiteHome({ params: { urlToOpen: this.urlToOpen } });
|
await CoreNavigator.navigateToSiteHome({ params: { urlToOpen: this.urlToOpen } });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreLoginHelper.treatUserTokenError(siteUrl, error, username, password);
|
CoreLoginHelper.treatUserTokenError(siteUrl, error, username, password);
|
||||||
|
|
|
@ -23,7 +23,7 @@ import { CoreLoginHelper } from '@features/login/services/login-helper';
|
||||||
import { CoreSiteIdentityProvider, CoreSitePublicConfigResponse } from '@classes/site';
|
import { CoreSiteIdentityProvider, CoreSitePublicConfigResponse } from '@classes/site';
|
||||||
import { CoreEvents } from '@singletons/events';
|
import { CoreEvents } from '@singletons/events';
|
||||||
import { CoreError } from '@classes/errors/error';
|
import { CoreError } from '@classes/errors/error';
|
||||||
import { CoreNavigationOptions, CoreNavigator, CoreRedirectPayload } from '@services/navigator';
|
import { CoreNavigationOptions, CoreNavigator } from '@services/navigator';
|
||||||
import { CoreForms } from '@singletons/form';
|
import { CoreForms } from '@singletons/form';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -208,13 +208,9 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
|
||||||
this.credForm.controls['password'].reset();
|
this.credForm.controls['password'].reset();
|
||||||
|
|
||||||
// Go to the site initial page.
|
// Go to the site initial page.
|
||||||
// @todo test that this is working properly (could we use navigateToSitePath instead?).
|
this.page
|
||||||
await CoreNavigator.navigateToSiteHome({
|
? await CoreNavigator.navigateToSitePath(this.page, { params: this.pageOptions })
|
||||||
params: {
|
: await CoreNavigator.navigateToSiteHome();
|
||||||
redirectPath: this.page,
|
|
||||||
redirectOptions: this.pageOptions,
|
|
||||||
} as CoreRedirectPayload,
|
|
||||||
});
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreLoginHelper.treatUserTokenError(this.siteUrl, error, this.username, password);
|
CoreLoginHelper.treatUserTokenError(this.siteUrl, error, this.username, password);
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ export class CoreMainMenuHomePage implements OnInit {
|
||||||
*/
|
*/
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.route.queryParams.subscribe((params: Partial<CoreRedirectPayload> & { urlToOpen?: string }) => {
|
this.route.queryParams.subscribe((params: Partial<CoreRedirectPayload> & { urlToOpen?: string }) => {
|
||||||
this.urlToOpen = params.urlToOpen;
|
this.urlToOpen = params.urlToOpen ?? this.urlToOpen;
|
||||||
|
|
||||||
if (params.redirectPath) {
|
if (params.redirectPath) {
|
||||||
this.pendingRedirect = {
|
this.pendingRedirect = {
|
||||||
|
|
|
@ -455,7 +455,6 @@ export class CoreSettingsHelperProvider {
|
||||||
*/
|
*/
|
||||||
canIUsePrefersColorScheme(): boolean {
|
canIUsePrefersColorScheme(): boolean {
|
||||||
// The following check will check browser support but system may differ from that.
|
// The following check will check browser support but system may differ from that.
|
||||||
// @todo Detect SO support to watch media query.
|
|
||||||
return window.matchMedia('(prefers-color-scheme)').media !== 'not all';
|
return window.matchMedia('(prefers-color-scheme)').media !== 'not all';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -199,8 +199,6 @@ export class CoreNavigatorService {
|
||||||
const siteId = options.siteId ?? CoreSites.getCurrentSiteId();
|
const siteId = options.siteId ?? CoreSites.getCurrentSiteId();
|
||||||
const navigationOptions: CoreNavigationOptions = CoreObject.without(options, ['siteId']);
|
const navigationOptions: CoreNavigationOptions = CoreObject.without(options, ['siteId']);
|
||||||
|
|
||||||
// @todo: When this function was in ContentLinksHelper, this code was inside NgZone. Check if it's needed.
|
|
||||||
|
|
||||||
// If the path doesn't belong to a site, call standard navigation.
|
// If the path doesn't belong to a site, call standard navigation.
|
||||||
if (siteId === CoreConstants.NO_SITE_ID) {
|
if (siteId === CoreConstants.NO_SITE_ID) {
|
||||||
return this.navigate(path, {
|
return this.navigate(path, {
|
||||||
|
@ -408,10 +406,6 @@ export class CoreNavigatorService {
|
||||||
* @return Whether navigation suceeded.
|
* @return Whether navigation suceeded.
|
||||||
*/
|
*/
|
||||||
protected async navigateToMainMenuPath(path: string, options: CoreNavigationOptions = {}): Promise<boolean> {
|
protected async navigateToMainMenuPath(path: string, options: CoreNavigationOptions = {}): Promise<boolean> {
|
||||||
// Due to DeepLinker, we need to remove the path from the URL before going to main menu.
|
|
||||||
// IonTabs checks the URL to determine which path to load for deep linking, so we clear the URL.
|
|
||||||
// @todo this.location.replaceState('');
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
preferCurrentTab: true,
|
preferCurrentTab: true,
|
||||||
...options,
|
...options,
|
||||||
|
@ -441,7 +435,6 @@ export class CoreNavigatorService {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open the path within the default main tab.
|
// Open the path within the default main tab.
|
||||||
// @todo test that this is working as expected
|
|
||||||
return this.navigate(`/main/${DEFAULT_MAIN_MENU_TAB}`, {
|
return this.navigate(`/main/${DEFAULT_MAIN_MENU_TAB}`, {
|
||||||
...options,
|
...options,
|
||||||
params: {
|
params: {
|
||||||
|
|
|
@ -752,7 +752,6 @@ export class CoreSitesProvider {
|
||||||
};
|
};
|
||||||
|
|
||||||
const siteId = this.getCurrentSiteId();
|
const siteId = this.getCurrentSiteId();
|
||||||
|
|
||||||
const downloadUrl = CoreApp.getAppStoreUrl(storesConfig);
|
const downloadUrl = CoreApp.getAppStoreUrl(storesConfig);
|
||||||
|
|
||||||
if (downloadUrl != null) {
|
if (downloadUrl != null) {
|
||||||
|
@ -773,10 +772,8 @@ export class CoreSitesProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (siteId) {
|
if (siteId) {
|
||||||
// Logout if it's the currentSite.
|
// Logout the currentSite.
|
||||||
if (siteId == this.getCurrentSiteId()) {
|
|
||||||
await this.logout();
|
await this.logout();
|
||||||
}
|
|
||||||
|
|
||||||
// Always expire the token.
|
// Always expire the token.
|
||||||
await this.setSiteLoggedOut(siteId, true);
|
await this.setSiteLoggedOut(siteId, true);
|
||||||
|
|
Loading…
Reference in New Issue