Beispiel #1
0
      }).subscribe(intros => {
        if (intros.length > 0) {
          const [currentIntro] = intros;
          if (currentIntro._id != this.state.currentIntro._id) {
            try {
              logger.debug('not the same intro');
              VibrationIOS.vibrate();
              clearInterval(this.state.timer);
              this.setState({ timer: undefined });
            } catch(err) {
              logger.warning('Cannot Vibrate: ' + JSON.stringify(err));
            }
          }
          currentIntro.user = this.props.ddp._formatUser(currentIntro.user);

          this.setState({
            currentIntro: currentIntro,
            loaded: true,
          });

          if (this.state.loaded) {
            try {
              if (this.state.timer) {
                clearInterval(this.state.timer);
              }
              
              if (this.props.overrideText) {
                this.setState({ countdown: this.props.overrideText });
                return;
              }

              let timerFunction = function() {
                let nextMatchDateSettings = currentIntro.nextMatchDate;
                if (!nextMatchDateSettings) {
                  return;
                }

                let formattedDate = '00:00'
                if (nextMatchDateSettings > new Date()) {
                  formattedDate = moment.duration(nextMatchDateSettings - new Date()).format("mm:ss", { trim: false });
                }
                this.setState({ countdown: formattedDate });
              }

              timerFunction.bind(this)();
              this.setState({ timer: setInterval(timerFunction.bind(this), 1000) })
            } catch(err) {
              logger.error(err);
            }
          }
        }
      });
 setTimeout(() => {
   VibrationIOS.vibrate();
   onSucess(result.data);
 }, 1000);
Beispiel #3
0
 onPress={() => VibrationIOS.vibrate()}>
Beispiel #4
0
 setTimeout(function() {
   VibrationIOS.vibrate();
   $this.props.onSucess(result.data);
 }, 1000);
Beispiel #5
0
 vibration:function(){
   VibrationIOS.vibrate();
 }