mirror of https://github.com/embarklabs/embark.git
hide the serach Error when there is a success
This commit is contained in:
parent
03a32f0434
commit
5f53d6bf2e
|
@ -17,7 +17,6 @@ import {
|
|||
import {explorerSearch} from "../actions";
|
||||
import {LIGHT_THEME, DARK_THEME} from '../constants';
|
||||
import FontAwesome from 'react-fontawesome';
|
||||
import { } from 'reactstrap';
|
||||
|
||||
import "./Layout.css";
|
||||
|
||||
|
@ -92,6 +91,8 @@ class Layout extends React.Component {
|
|||
if (nextProps.searchResult.error) {
|
||||
this.setState({searchError: true});
|
||||
return true;
|
||||
} else {
|
||||
this.setState({searchError: false});
|
||||
}
|
||||
|
||||
if (nextProps.searchResult.className) {
|
||||
|
@ -247,7 +248,7 @@ class Layout extends React.Component {
|
|||
}
|
||||
|
||||
<main className="main">
|
||||
<Alert color="danger" isOpen={this.state.searchError} toggle={() => this.dismissSearchError()}>
|
||||
<Alert color="danger" isOpen={(this.state.searchError && Boolean(searchResult.error))} toggle={() => this.dismissSearchError()}>
|
||||
{searchResult.error}
|
||||
</Alert>
|
||||
|
||||
|
|
Loading…
Reference in New Issue