diff --git a/client/src/routes/Search/index.tsx b/client/src/routes/Search/index.tsx index a3f9e3b..565581b 100644 --- a/client/src/routes/Search/index.tsx +++ b/client/src/routes/Search/index.tsx @@ -139,12 +139,11 @@ class Search extends PureComponent { } private pendingSearch = () => { - this.setState({isLoading:true},()=>{ - if(this.timeout){ - clearTimeout(this.timeout) - } - this.timeout = setTimeout(this.executeSearch,250); - }) + this.setState({isLoading:true}) + if(this.timeout){ + clearTimeout(this.timeout) + } + this.timeout = setTimeout(this.executeSearch,500); } private executeSearch=()=>{ @@ -153,11 +152,11 @@ class Search extends PureComponent { } public setCategory = (category: string) => { - this.setState({ category }, () => this.searchAssets()) + this.setState({ category, isLoading: true }, () => this.searchAssets()) } public setLicense = (license: string) => { - this.setState({ license }, () => this.searchAssets()) + this.setState({ license, isLoading: true }, () => this.searchAssets()) } public renderResults = () =>