@@ -11,13 +11,6 @@ export class MatchKontextComponent {
1111 /** full tablet state; may be null until loaded */
1212 @Input ( ) infos : TabletSchusszettel | null = null ;
1313
14- /** Getter methods to safely access wettkampfInfo properties */
15- get today ( ) : string {
16- return this . infos ?. wettkampfInfo ?. wettkampfDatum
17- ? new Date ( this . infos . wettkampfInfo . wettkampfDatum ) . toLocaleDateString ( 'de-DE' )
18- : new Date ( ) . toLocaleDateString ( 'de-DE' ) ;
19- }
20-
2114 get wettkampfName ( ) : string {
2215 return this . infos ?. wettkampfInfo ?. wettkampftypName || 'Unbekannt' ;
2316 }
@@ -30,24 +23,10 @@ export class MatchKontextComponent {
3023 return this . infos ?. wettkampfInfo ?. veranstaltungName || 'Unbekannt' ;
3124 }
3225
33- get ort ( ) : string {
34- const ortsname = this . infos ?. wettkampfInfo ?. wettkampfOrtsname || '' ;
35- const ortsinfo = this . infos ?. wettkampfInfo ?. wettkampfOrtsinfo || '' ;
36-
37- if ( ortsname && ortsinfo ) {
38- return `${ ortsname } , ${ ortsinfo } ` ;
39- }
40- return ortsname || ortsinfo || 'Unbekannt' ;
41- }
42-
4326 get wettkampfTag ( ) : number | string {
4427 return this . infos ?. wettkampfInfo ?. wettkampfTag || 'Unbekannt' ;
4528 }
4629
47- get beginn ( ) : string {
48- return this . infos ?. wettkampfInfo ?. wettkampfBeginn || 'Unbekannt' ;
49- }
50-
5130 get sportjahr ( ) : number | string {
5231 return this . infos ?. wettkampfInfo ?. veranstaltungSportjahr || 'Unbekannt' ;
5332 }
@@ -58,13 +37,15 @@ export class MatchKontextComponent {
5837 if ( this . infos ?. currentPasseNumber != null && this . infos . currentPasseNumber > 0 ) {
5938 return this . infos . currentPasseNumber ;
6039 }
61-
40+
41+
6242 // Fallback calculation if backend value not available
6343 if ( ! this . infos ?. satzErgebnisse || this . infos . satzErgebnisse . length === 0 ) {
6444 return 1 ;
6545 }
66-
46+
6747 const completedPasses = this . infos . satzErgebnisse . length ;
6848 return completedPasses + 1 ;
6949 }
50+
7051}
0 commit comments