Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70980

Countdown not working when take value from storage

$
0
0

@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 constructor

   this.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

Read full topic


Viewing all articles
Browse latest Browse all 70980

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>