1- import { Component , inject , output , AfterViewInit } from '@angular/core' ;
1+ import { Component , inject , output , AfterViewInit , type OnInit } from '@angular/core' ;
22import { TranslatePipe , TranslateService } from '@ngx-translate/core' ;
33import { clickExternalHref } from '../../model/external-links' ;
44import { GameModes } from '../../model/consts' ;
@@ -23,7 +23,7 @@ interface StatGroup {
2323 styleUrls : [ './help.component.scss' ] ,
2424 imports : [ TranslatePipe , DurationPipe ]
2525} )
26- export class HelpComponent implements AfterViewInit {
26+ export class HelpComponent implements OnInit {
2727 readonly showTutorial = output ( ) ;
2828 readonly gameModes = GameModes ;
2929 statsGroups : Array < StatGroup > = [ ] ;
@@ -43,7 +43,7 @@ export class HelpComponent implements AfterViewInit {
4343 { icon : 'icon-logo' , key : 'H' , name : 'HELP' }
4444 ] ;
4545
46- ngAfterViewInit ( ) : void {
46+ ngOnInit ( ) : void {
4747 this . statsGroups = this . buildStatsGroups ( ) ;
4848 }
4949
@@ -73,7 +73,11 @@ export class HelpComponent implements AfterViewInit {
7373
7474 clearTimesClick ( ) : void {
7575 if ( confirm ( this . translate . instant ( 'BEST_TIMES_CLEAR_SURE' ) ) ) {
76- this . clearTimes ( ) . catch ( error => console . error ( error ) ) ;
76+ this . clearTimes ( )
77+ . then ( ( ) => {
78+ this . statsGroups = [ ] ;
79+ } )
80+ . catch ( error => console . error ( error ) ) ;
7781 }
7882 }
7983
0 commit comments