From 40350ef7215ee67410be81dfaf483e5c4d0ffa9c Mon Sep 17 00:00:00 2001 From: Rayson Yeap <88478542+Respirayson@users.noreply.github.com> Date: Sat, 22 Jun 2024 22:30:07 +0800 Subject: [PATCH] Remove duplicate call to loadfeedbacksessionsforcourse (#13130) --- .../student-home-page/student-home-page.component.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/web/app/pages-student/student-home-page/student-home-page.component.ts b/src/web/app/pages-student/student-home-page/student-home-page.component.ts index 5f268335e6d..00f5f2d713d 100644 --- a/src/web/app/pages-student/student-home-page/student-home-page.component.ts +++ b/src/web/app/pages-student/student-home-page/student-home-page.component.ts @@ -115,10 +115,6 @@ export class StudentHomePageComponent implements OnInit { }); this.sortCoursesBy(SortBy.COURSE_CREATION_DATE); - this.courses.slice(0, 3).forEach((course: StudentCourse) => { - course.isTabExpanded = true; - this.loadFeedbackSessionsForCourse(course.course.courseId); - }); }, error: (e: ErrorMessageOutput) => { this.hasCoursesLoadingFailed = true; @@ -306,11 +302,9 @@ export class StudentHomePageComponent implements OnInit { this.courses = copy; // open the first three panels - this.courses.forEach((course: StudentCourse, idx: number) => { - course.isTabExpanded = idx < 3; - if (idx < 3) { - this.loadFeedbackSessionsForCourse(course.course.courseId); - } + this.courses.slice(0, 3).forEach((course: StudentCourse) => { + course.isTabExpanded = true; + this.loadFeedbackSessionsForCourse(course.course.courseId); }); }