@@ -22,7 +22,7 @@ export class WrongAnswerWindowComponent implements OnInit {
2222 private wrongAnswerSound : HTMLAudioElement = new Audio ( 'assets/sounds/critical_stop.wav' ) ;
2323
2424 constructor (
25- private readonly router : Router ,
25+ protected readonly router : Router ,
2626 private readonly route : ActivatedRoute ,
2727 private readonly encryptionService : EncryptionService ,
2828 private readonly templateService : TemplateService ,
@@ -34,18 +34,14 @@ export class WrongAnswerWindowComponent implements OnInit {
3434 await this . retrieveRouteParams ( ) ;
3535
3636 if ( ! this . appStorageService . canQuizBeAnswered ( ) ) {
37- await this . returnHome ( ) ;
37+ await this . router . navigateByUrl ( PathsEnum . HOME ) ;
3838 return ;
3939 }
4040
4141 await this . wrongAnswerSound . play ( ) ;
4242 this . saveCurrentScore ( ) ;
4343 }
4444
45- public async returnHome ( ) : Promise < void > {
46- await this . router . navigateByUrl ( PathsEnum . HOME ) ;
47- }
48-
4945 public async showClipboardMessage ( ) : Promise < void > {
5046 this . displayClipboardMessage = true ;
5147
@@ -71,4 +67,6 @@ export class WrongAnswerWindowComponent implements OnInit {
7167 this . correctAnswers = 'questions' in questionResult ? questionResult . correctAnswers : [ questionResult . rightAnswer ] ;
7268 this . clipboardText = await this . templateService . render ( gameMode . templateEnum , questionResult ) ;
7369 }
70+
71+ protected readonly PathsEnum = PathsEnum ;
7472}
0 commit comments