handleSessionConfirm()

in index.js [43:63]


  handleSessionConfirm(sessionObject) {
    const { innerRef } = this.props;
    this.setState({
      // The OR makes it work even without the augmented webchat channel
      propsRetrieved: { ...sessionObject.props }
    });
    if (
      ((innerRef && innerRef.current) || this.webchatRef.updateRules) &&
              sessionObject.props &&
              sessionObject.props.rules
    ) {
      setTimeout(() => {
        if (innerRef && innerRef.current) {
          innerRef.current.updateRules(sessionObject.props.rules);
        } else {
          this.webchatRef.updateRules(sessionObject.props.rules);
        }
      }, 100);
      this.setState({ rulesApplied: true });
    }
  }