MOBILE-4623 imscp: Fix issue with single activity format

main
Dani Palou 2024-07-08 08:35:20 +02:00
parent cefe0e4ac1
commit 46c305b563
1 changed files with 11 additions and 8 deletions

View File

@ -19,7 +19,7 @@ import { CoreCourse } from '@features/course/services/course';
import { CoreNavigator } from '@services/navigator'; import { CoreNavigator } from '@services/navigator';
import { AddonModImscp, AddonModImscpTocItem } from '../../services/imscp'; import { AddonModImscp, AddonModImscpTocItem } from '../../services/imscp';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
import { ADDON_MOD_IMSCP_COMPONENT } from '../../constants'; import { ADDON_MOD_IMSCP_COMPONENT, ADDON_MOD_IMSCP_PAGE_NAME } from '../../constants';
/** /**
* Component that displays a IMSCP. * Component that displays a IMSCP.
@ -113,14 +113,17 @@ export class AddonModImscpIndexComponent extends CoreCourseModuleMainResourceCom
* *
* @param href Item href to open, undefined for last item seen. * @param href Item href to open, undefined for last item seen.
*/ */
openImscp(href?: string): void { async openImscp(href?: string): Promise<void> {
CoreNavigator.navigate('view', { await CoreNavigator.navigateToSitePath(
params: { `${ADDON_MOD_IMSCP_PAGE_NAME}/${this.courseId}/${this.module.id}/view`,
cmId: this.module.id, {
courseId: this.courseId, params: {
initialHref: href, cmId: this.module.id,
courseId: this.courseId,
initialHref: href,
},
}, },
}); );
this.hasStarted = true; this.hasStarted = true;
} }