endChallenge()

in source/client/src/liveness/pose/PoseChallenge.tsx [59:78]


  endChallenge() {
    const base64Photo = CanvasUtils.getPhotoFromCanvas("canvas-invisible", ConfigUtils.getConfig().IMAGE_JPG_QUALITY);
    this.setState({
      uploading: true
    });
    const self = this;
    APIUtils.putChallengeFrame(
      this.props.challengeMetadata.id,
      this.props.challengeMetadata.token,
      base64Photo,
      Date.now()
    )
      .then(() => this.props.onLocalEnd(true))
      .catch(error => this.props.onError(error))
      .finally(() => {
        self.setState({
          uploading: false
        });
      });
  }