Added possible fix for toLowerCase() errors in PROD

This commit is contained in:
Erik Tiekstra
2021-12-15 08:44:43 +01:00
parent a6f37923ab
commit fa82a023c0
3 changed files with 4 additions and 3 deletions

View File

@@ -27,7 +27,8 @@ export class ToastComponent implements AfterViewInit {
}
get className(): string {
return `toast toast--${this.error.severity.toLowerCase()}`;
const severity = this.error.severity || ErrorSeverity.HIGH;
return `toast toast--${severity.toLowerCase()}`;
}
emitCloseEvent(): void {

View File

@@ -53,7 +53,7 @@
[afActive]="activeReportMotivation"
(afOnPrimaryClick)="closeMotivationDialog()"
(afOnInactive)="closeMotivationDialog()"
[afHeading]="'Motivering till beslut: ' + activeReportMotivation.type + ' ' + activeReportMotivation.status.toLowerCase()"
[afHeading]="'Motivering till beslut: ' + activeReportMotivation.type + ' ' + activeReportMotivation.status?.toLowerCase()"
afHeadingLevel="h2"
afPrimaryButtonText="Stäng"
>

View File

@@ -1,4 +1,4 @@
export function capitalizeWords(words: string): string {
export function capitalizeWords(words: string = ''): string {
return words
.split(' ')
.map(word => `${word.charAt(0).toUpperCase()}${word.slice(1).toLowerCase()}`)