diff --git a/web/src/App.js b/web/src/App.js index 7d1e21b..cd6e3eb 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -257,10 +257,13 @@ class App extends Component { //will be kept in filteredIntents. After filterring, there should be only one //intent left, the selected one + let selectedIntentQuestionsForSearch = selectedIntent.questions.map(question=> + question.toLowerCase().trim()); + let filteredIntents = this.state.allIntents.filter(intent=>{ - let result = (selectedIntent.intentName === intent.intentName); + let result = (selectedIntent.intentName.toLowerCase().trim() === intent.intentName.toLowerCase().trim()); let filteredQuestions = intent.questions.filter(question=>{ - return (selectedIntent.questions.indexOf(question)!==-1); + return (selectedIntentQuestionsForSearch.indexOf(question.toLowerCase().trim())!==-1); }); return (result || filteredQuestions.length > 0); });