Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (typeof value === 'string') {
// TODO: [P4] Instead of calling dispatch, we should move to dispatchers instead for completeness
dispatch(sendMessage(value, 'imBack'));
} else {
throw new Error('cannot send "imBack" with a non-string value');
}
break;
case 'messageBack':
dispatch(sendMessageBack(value, text, displayText));
break;
case 'postBack':
dispatch(sendPostBack(value));
break;
case 'call':
case 'downloadFile':
case 'openUrl':
case 'playAudio':
case 'playVideo':
case 'showImage':
window.open(value);
break;
case 'signin': {
// TODO: [P3] We should prime the URL into the OAuthCard directly, instead of calling getSessionId on-demand
// This is to eliminate the delay between window.open() and location.href call