Skip to content

Commit

Permalink
Fix rabbit 01
Browse files Browse the repository at this point in the history
  • Loading branch information
FelberMartin committed Feb 21, 2025
1 parent 6edbdde commit de82dcc
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/main/webapp/app/overview/header-course.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, HostListener, Input, OnChanges, OnInit, inject } from '@angular/core';
import { Component, HostListener, Input, OnChanges, inject } from '@angular/core';
import { Course } from 'app/entities/course.model';
import { ARTEMIS_DEFAULT_COLOR } from 'app/app.constants';
import { CachingStrategy } from 'app/shared/image/secured-image.component';
Expand All @@ -17,7 +17,7 @@ import { getContrastingTextColor } from 'app/utils/color.utils';
styleUrls: ['./header-course.component.scss'],
imports: [NgStyle, FaIconComponent, TranslateDirective, RouterLink, SecuredImageComponent, ArtemisTranslatePipe],
})
export class HeaderCourseComponent implements OnChanges, OnInit {
export class HeaderCourseComponent implements OnChanges {
protected router = inject(Router);

readonly ARTEMIS_DEFAULT_COLOR = ARTEMIS_DEFAULT_COLOR;
Expand All @@ -33,18 +33,12 @@ export class HeaderCourseComponent implements OnChanges, OnInit {

faArrowDown = faArrowDown;

// Removed ngOnInit to consolidate initialization logic

ngOnChanges() {
this.courseColor = this.course.color || ARTEMIS_DEFAULT_COLOR;
this.contentColor = getContrastingTextColor(this.courseColor);
this.adjustCourseDescription();
}

ngOnChanges() {
this.adjustCourseDescription();
}

@HostListener('window:resize')
onResize() {
this.adjustCourseDescription();
Expand Down

0 comments on commit de82dcc

Please sign in to comment.