little fixes

This commit is contained in:
Jonathan Rainville 2018-10-16 16:17:17 -04:00 committed by Pascal Precht
parent 224a5bd3fd
commit 5cfe208f6f
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
2 changed files with 6 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;