1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

add loading to category and license

This commit is contained in:
Jernej Pregelj 2019-08-06 11:42:58 +02:00 committed by Matthias Kretschmann
parent 69365d3d93
commit c28974f019
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -139,12 +139,11 @@ class Search extends PureComponent<SearchProps, SearchState> {
} }
private pendingSearch = () => { private pendingSearch = () => {
this.setState({isLoading:true},()=>{ this.setState({isLoading:true})
if(this.timeout){ if(this.timeout){
clearTimeout(this.timeout) clearTimeout(this.timeout)
} }
this.timeout = setTimeout(this.executeSearch,250); this.timeout = setTimeout(this.executeSearch,500);
})
} }
private executeSearch=()=>{ private executeSearch=()=>{
@ -153,11 +152,11 @@ class Search extends PureComponent<SearchProps, SearchState> {
} }
public setCategory = (category: string) => { public setCategory = (category: string) => {
this.setState({ category }, () => this.searchAssets()) this.setState({ category, isLoading: true }, () => this.searchAssets())
} }
public setLicense = (license: string) => { public setLicense = (license: string) => {
this.setState({ license }, () => this.searchAssets()) this.setState({ license, isLoading: true }, () => this.searchAssets())
} }
public renderResults = () => public renderResults = () =>