MOBILE-3833 siteplugins: Use new icon function

main
Pau Ferrer Ocaña 2022-04-08 16:17:47 +02:00
parent 72c516b88c
commit 6af2141284
1 changed files with 4 additions and 11 deletions

View File

@ -63,18 +63,18 @@ export class CoreSitePluginsModuleHandler extends CoreSitePluginsBaseHandler imp
/**
* @inheritdoc
*/
getData(
async getData(
module: CoreCourseModuleData,
courseId: number,
sectionId?: number,
forCoursePage?: boolean,
): CoreCourseModuleHandlerData {
): Promise<CoreCourseModuleHandlerData> {
if (this.shouldOnlyDisplayDescription(module, forCoursePage)) {
const title = module.description;
module.description = '';
return {
icon: this.getIconSrc(),
icon: await CoreCourse.getModuleIconSrc(module.modname, this.handlerSchema.displaydata?.icon),
title: title || '',
a11yTitle: '',
class: this.handlerSchema.displaydata?.class,
@ -85,7 +85,7 @@ export class CoreSitePluginsModuleHandler extends CoreSitePluginsBaseHandler imp
const showDowloadButton = this.handlerSchema.downloadbutton;
const handlerData: CoreCourseModuleHandlerData = {
title: module.name,
icon: this.getIconSrc(),
icon: await CoreCourse.getModuleIconSrc(module.modname, this.handlerSchema.displaydata?.icon),
class: this.handlerSchema.displaydata?.class,
showDownloadButton: showDowloadButton !== undefined ? showDowloadButton : hasOffline,
};
@ -198,13 +198,6 @@ export class CoreSitePluginsModuleHandler extends CoreSitePluginsBaseHandler imp
}
}
/**
* @inheritdoc
*/
getIconSrc(): string | undefined {
return this.handlerSchema.displaydata?.icon;
}
/**
* @inheritdoc
*/