Fix click search

This commit is contained in:
Wisani Shilumani 2018-07-13 13:39:01 +02:00
parent f739a64f96
commit 111191ed02
2 changed files with 5 additions and 3 deletions

View File

@ -17,7 +17,7 @@ class BrowseArchives extends React.Component {
this.state = {
term: '',
debounceTerm: '',
searchResults: [],
searchResults: [null],
isSingleInterviewModalOpen: false,
isInterviewsListModalOpen: false,
activeSingleInterviewId: 1,
@ -39,7 +39,7 @@ class BrowseArchives extends React.Component {
this.setState({
term: event.target.value,
isSearchActive: true,
searchResults: [],
searchResults: [null],
});
if (event.target.value.length === 0) {

View File

@ -4,8 +4,10 @@ import './style.scss';
import Parser from 'html-react-parser';
const SearchResults = (props) => {
if (!props.data || props.data.length < 1) {
if (!props.data || props.data[0] === null) {
return <div>Loading...</div>;
} else if (props.data.length < 1) {
return <div> No results found </div>;
}
// sort array alphabetically