MOBILE-3320 wiki: Fix animation when going back to home page

main
Dani Palou 2021-06-14 14:03:36 +02:00
parent 11f47a7f7c
commit ad56eeb203
2 changed files with 4 additions and 3 deletions

View File

@ -590,7 +590,7 @@ export class AddonModWikiIndexComponent extends CoreCourseModuleMainActivityComp
if (modalData) {
if (modalData.home) {
// Go back to the initial page of the wiki.
CoreNavigator.navigateToSitePath(modalData.home);
CoreNavigator.navigateToSitePath(modalData.home, { animationDirection: 'back' });
} else if (modalData.page) {
this.goToPage(modalData.page);
}

View File

@ -44,8 +44,7 @@ export type CoreRedirectPayload = {
/**
* Navigation options.
*/
export type CoreNavigationOptions = {
animated?: boolean;
export type CoreNavigationOptions = Pick<NavigationOptions, 'animated'|'animation'|'animationDirection'> & {
params?: Params;
reset?: boolean;
preferCurrentTab?: boolean; // Default true.
@ -132,6 +131,8 @@ export class CoreNavigatorService {
const url: string[] = [/^[./]/.test(path) ? path : `./${path}`];
const navigationOptions: NavigationOptions = CoreObject.withoutEmpty({
animated: options.animated,
animation: options.animation,
animationDirection: options.animationDirection,
queryParams: CoreObject.isEmpty(options.params ?? {}) ? null : CoreObject.withoutEmpty(options.params),
relativeTo: path.startsWith('/') ? null : this.getCurrentRoute(),
});