From 9fd657ae693737077676f29a89aa482c75b0b941 Mon Sep 17 00:00:00 2001 From: agnescameron Date: Wed, 5 Feb 2020 12:38:15 -0500 Subject: [PATCH] small correction --- src/App.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/App.js b/src/App.js index 0434a5d..1ebe255 100644 --- a/src/App.js +++ b/src/App.js @@ -60,11 +60,11 @@ class App extends Component { } } - processResponse = async (text) => { + processResponse = (text) => { let messages; //check if message pure punctuation, let it pass if so - if(text.match(/[a-zA-Z\s]/g)){ + if(text.match(/[a-zA-Z]/g)){ //breaks sentences into different messages messages = text .match(/[^.!?]+[.!?]*/g) @@ -72,6 +72,9 @@ class App extends Component { } else messages = text; + //error handling + if(!messages) messages = "huh??"; + this.botQueue = this.botQueue.concat(messages); // start processing bot queue