MOBILE-3833 course: Remove duplicated side blocks button

main
Pau Ferrer Ocaña 2022-03-29 10:24:16 +02:00
parent c139683631
commit 0a950061d7
3 changed files with 2 additions and 13 deletions

View File

@ -44,7 +44,7 @@
</core-dynamic-component>
<core-block-side-blocks-button slot="fixed" *ngIf="loaded && course && displayBlocks && hasBlocks" contextlevel="course"
<core-block-side-blocks-button slot="fixed" *ngIf="loaded && course && displayBlocks && hasBlocks" contextLevel="course"
[instanceId]="course.id">
</core-block-side-blocks-button>

View File

@ -1,6 +1,3 @@
<div class="list-item-limited-width">
<core-dynamic-component [component]="componentClass" [data]="data"></core-dynamic-component>
</div>
<core-block-side-blocks-button slot="fixed" *ngIf="course && hasBlocks" contextLevel="course" [instanceId]="course.id">
</core-block-side-blocks-button>

View File

@ -20,7 +20,6 @@ import { CoreDynamicComponent } from '@components/dynamic-component/dynamic-comp
import { CoreCourseAnyCourseData } from '@features/courses/services/courses';
import { IonRefresher } from '@ionic/angular';
import { CoreCourseModuleCompletionData, CoreCourseSection } from '@features/course/services/course-helper';
import { CoreBlockHelper } from '@features/block/services/block-helper';
import { CoreCourse } from '@features/course/services/course';
/**
@ -46,7 +45,6 @@ export class CoreCourseFormatSingleActivityComponent implements OnChanges {
componentClass?: Type<unknown>; // The class of the component to render.
data: Record<string | number, unknown> = {}; // Data to pass to the component.
hasBlocks = false;
/**
* @inheritdoc
@ -60,8 +58,6 @@ export class CoreCourseFormatSingleActivityComponent implements OnChanges {
return;
}
this.hasBlocks = await CoreBlockHelper.hasCourseBlocks(this.course.id);
// In single activity the module should only have 1 section and 1 module. Get the module.
const module = this.sections?.[0].modules?.[0];
@ -93,11 +89,7 @@ export class CoreCourseFormatSingleActivityComponent implements OnChanges {
if (this.course) {
const courseId = this.course.id;
await CoreCourse.invalidateCourseBlocks(courseId).then(async () => {
this.hasBlocks = await CoreBlockHelper.hasCourseBlocks(courseId);
return;
});
await CoreCourse.invalidateCourseBlocks(courseId);
}
}