diff --git a/embark-ui/src/actions/index.js b/embark-ui/src/actions/index.js index ea475776..026d6441 100644 --- a/embark-ui/src/actions/index.js +++ b/embark-ui/src/actions/index.js @@ -366,7 +366,7 @@ export function listenToGasOracle(){ export function stopGasOracle(){ return { type: STOP_GAS_ORACLE - } + }; } // Actions without Side Effect diff --git a/embark-ui/src/components/ExplorerLayout.js b/embark-ui/src/components/ExplorerLayout.js index 8f238b16..48640c77 100644 --- a/embark-ui/src/components/ExplorerLayout.js +++ b/embark-ui/src/components/ExplorerLayout.js @@ -4,6 +4,7 @@ import connect from "react-redux/es/connect/connect"; import {Route, Switch, withRouter} from 'react-router-dom'; import {explorerSearch} from "../actions"; import {searchResult} from "../reducers/selectors"; +import {Alert} from 'reactstrap'; import AccountsContainer from '../containers/AccountsContainer'; import AccountContainer from '../containers/AccountContainer'; @@ -16,7 +17,10 @@ import SearchBar from '../components/SearchBar'; class ExplorerLayout extends React.Component { shouldComponentUpdate(nextProps) { if (nextProps.searchResult && nextProps.searchResult !== this.props.searchResult) { - console.log('New result', nextProps.searchResult); + if (nextProps.searchResult.error) { + return true; + } + if (nextProps.searchResult.address) { this.props.history.push(`/embark/explorer/accounts/${nextProps.searchResult.address}`); return false; @@ -35,11 +39,11 @@ class ExplorerLayout extends React.Component { } render() { - const {explorerSearch} = this.props; + const {explorerSearch, searchResult} = this.props; return ( explorerSearch(searchValue)}/> - {searchResult && {JSON.stringify(searchResult)}} + {searchResult.error && {searchResult.error}} diff --git a/embark-ui/src/sagas/index.js b/embark-ui/src/sagas/index.js index 355d5370..06097015 100644 --- a/embark-ui/src/sagas/index.js +++ b/embark-ui/src/sagas/index.js @@ -52,7 +52,7 @@ function *searchExplorer(entity, payload) { return yield put(entity.success(result)); } - return yield put(entity.failure('No results')); + return yield put(entity.success({error: 'No result found in transactions, accounts or blocks'})); } export const fetchPlugins = doRequest.bind(null, actions.plugins, api.fetchPlugins);