fix bug in showing search box

This commit is contained in:
Roman Storm 2017-12-12 01:37:54 -08:00
parent 002a8d402a
commit 5f72ed52ca
1 changed files with 3 additions and 2 deletions

View File

@ -60,7 +60,8 @@ class AppMainRouter extends Component {
})
}
onRouteChange(){
if(history.location.pathname !== "/"){
const rootPath = this.rootPath + "/";
if(history.location.pathname !== rootPath){
this.setState({showSearch: false})
} else {
this.setState({showSearch: true})
@ -82,7 +83,7 @@ class AppMainRouter extends Component {
}
render(){
console.log('v2', this.rootPath)
console.log('v2.01', this.rootPath)
const search = this.state.showSearch ? <input type="text" className="search-input"/> : ''
const loading = this.state.loading ? <Loading /> : ''
return (