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 {explorerSearch} from "../actions";
|
||||||
import {LIGHT_THEME, DARK_THEME} from '../constants';
|
import {LIGHT_THEME, DARK_THEME} from '../constants';
|
||||||
import FontAwesome from 'react-fontawesome';
|
import FontAwesome from 'react-fontawesome';
|
||||||
import { } from 'reactstrap';
|
|
||||||
|
|
||||||
import "./Layout.css";
|
import "./Layout.css";
|
||||||
|
|
||||||
|
@ -92,6 +91,8 @@ class Layout extends React.Component {
|
||||||
if (nextProps.searchResult.error) {
|
if (nextProps.searchResult.error) {
|
||||||
this.setState({searchError: true});
|
this.setState({searchError: true});
|
||||||
return true;
|
return true;
|
||||||
|
} else {
|
||||||
|
this.setState({searchError: false});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextProps.searchResult.className) {
|
if (nextProps.searchResult.className) {
|
||||||
|
@ -247,7 +248,7 @@ class Layout extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
<main className="main">
|
<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}
|
{searchResult.error}
|
||||||
</Alert>
|
</Alert>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue