Skip to content

Commit

Permalink
Fixing updateGrade Method
Browse files Browse the repository at this point in the history
  • Loading branch information
Shounaks committed Nov 22, 2024
1 parent 91b4298 commit e3fdd3b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/app/common/grade-icon/grade-icon.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class GradeIconComponent implements OnInit, OnChanges {
@Input() grade?: number | string;
@Input() colorful: boolean = false;

gradeText: number | string = 'Grade';
gradeText: string = 'Grade';
gradeLetter: string = 'G';

constructor(private gradeService: GradeService) {}
Expand All @@ -27,10 +27,9 @@ export class GradeIconComponent implements OnInit, OnChanges {
}

private updateGrade(): void {
this.gradeText =
typeof this.grade === 'string'
? this.gradeService.stringToGrade(this.grade)
: this.gradeService.grades[this.grade] || 'Grade';
this.gradeLetter = this.gradeService.gradeAcronyms[this.grade] || 'G';
const grade: number =
typeof this.grade === 'string' ? this.gradeService.stringToGrade(this.grade) : this.grade;
this.gradeText = this.gradeService.grades[grade] || 'Grade';
this.gradeLetter = this.gradeService.gradeAcronyms[grade] || 'G';
}
}

0 comments on commit e3fdd3b

Please sign in to comment.