From 5cfe208f6ffe22ab853d904b96d70ffff41dff78 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Tue, 16 Oct 2018 16:17:17 -0400 Subject: [PATCH] little fixes --- embark-ui/src/reducers/index.js | 3 +++ embark-ui/src/sagas/index.js | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/embark-ui/src/reducers/index.js b/embark-ui/src/reducers/index.js index 9d2eda39f..7ef17cb5d 100644 --- a/embark-ui/src/reducers/index.js +++ b/embark-ui/src/reducers/index.js @@ -235,6 +235,9 @@ function searchResult(state = {}, action) { if (action.type === EXPLORER_SEARCH[SUCCESS]) { return action.searchResult; } + if (action.type === EXPLORER_SEARCH[REQUEST]) { + return {}; + } return state; } diff --git a/embark-ui/src/sagas/index.js b/embark-ui/src/sagas/index.js index 06097015d..5f47313aa 100644 --- a/embark-ui/src/sagas/index.js +++ b/embark-ui/src/sagas/index.js @@ -17,6 +17,7 @@ function *doRequest(entity, serviceFn, payload) { function *searchExplorer(entity, payload) { let result; + const SEARCH_LIMIT = 100; // Accounts yield fetchAccounts({}); @@ -30,7 +31,7 @@ function *searchExplorer(entity, payload) { } // Blocks - yield fetchBlocks({limit: 100}); + yield fetchBlocks({limit: SEARCH_LIMIT}); const blocks = yield select(getBlocks); const intSearchValue = parseInt(payload.searchValue, 10); result = blocks.find(block => { @@ -42,7 +43,7 @@ function *searchExplorer(entity, payload) { } // Transactions - yield fetchTransactions({blockLimit: 100}); + yield fetchTransactions({blockLimit: SEARCH_LIMIT}); const transactions = yield select(getTransactions); result = transactions.find(transaction => { return transaction.hash === payload.searchValue;