Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
RtcEngine.on('error', (data) => {
if (data.error === 17) {
RtcEngine.leaveChannel().then(_ => {
RtcEngine.destroy();
this.props.onCancel(data);
});
}
})
console.log("[CONFIG]", JSON.stringify(config));
handleCancel = () => {
RtcEngine.leaveChannel();
RtcEngine.removeAllListeners();
RtcEngine.destroy();
this.props.onCancel();
}
componentWillUnmount () {
if (this.state.joinSucceed) {
RtcEngine.leaveChannel();
RtcEngine.removeAllListeners();
RtcEngine.destroy();
}
}