Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
const { onComplete, botName } = this.props;
if (onComplete && botName) {
if (!Interactions || typeof Interactions.onComplete !== 'function') {
throw new Error(
'No Interactions module found, please ensure @aws-amplify/interactions is imported'
);
}
// @ts-ignore
Interactions.onComplete(botName, this.getOnComplete(onComplete, this));
}
}
componentDidUpdate(prevProps) {
const { onComplete, botName } = this.props;
if (botName && this.props.onComplete !== prevProps.onComplete) {
if (!Interactions || typeof Interactions.onComplete !== 'function') {
throw new Error(
'No Interactions module found, please ensure @aws-amplify/interactions is imported'
);
}
// @ts-ignore
Interactions.onComplete(botName, this.getOnComplete(onComplete, this));
}
}
componentDidMount() {
const {onComplete, botName} = this.props;
if(onComplete && botName) {
if (!Interactions || typeof Interactions.onComplete !== 'function') {
throw new Error('No Interactions module found, please ensure @aws-amplify/interactions is imported');
}
Interactions.onComplete(botName, this.getOnComplete(onComplete, this));
}
}
componentDidUpdate(prevProps) {
const {onComplete, botName} = this.props;
if (botName && this.props.onComplete !== prevProps.onComplete) {
if (!Interactions || typeof Interactions.onComplete !== 'function') {
throw new Error('No Interactions module found, please ensure @aws-amplify/interactions is imported');
}
Interactions.onComplete(botName, this.getOnComplete(onComplete, this));
}
}
componentDidMount() {
const { onComplete, botName } = this.props;
if (onComplete && botName) {
Interactions.onComplete(botName, this.getOnComplete(onComplete, this));
}
}
componentDidUpdate(prevProps) {
const { onComplete, botName } = this.props;
if (botName !== prevProps.botName || onComplete !== prevProps.onComplete) {
Interactions.onComplete(botName, this.getOnComplete(onComplete, this));
}
}