Added possible fix for toLowerCase() errors in PROD
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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"
|
||||
>
|
||||
|
||||
@@ -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()}`)
|
||||
|
||||
Reference in New Issue
Block a user