@safaAlshaarri wrote:
hi every one i have spelling game for Arabic language where i have timer this timer i take it’s value from another class the timer work but when it end nothing happens the timer is 0 but finally not working also when i get out of app the timer still working in the background here is the code :
this is inside constructorthis.storage.get('timerset').then((val)=> { this.simpletimer=val; this.timer=val; });
Times() { this.inputColor="#000"; this.counter$ = Observable.timer(0,this.tick).pipe( take(this.timer), map(() => --this.timer) ).finally(() =>{ alert(this.timer); this.endTimer(); }); }
endTimer(){ if((this.timer==0)){ this.answerAudio("timefinish","انتهي الوقت") this.inputColor="#FF0000"; this.playAudio(0); this.answer=this.Words[this.currentWords].word; console.log(this.answer); }
Posts: 1
Participants: 1