mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 06:16:01 +00:00
little fixes
This commit is contained in:
parent
224a5bd3fd
commit
5cfe208f6f
@ -235,6 +235,9 @@ function searchResult(state = {}, action) {
|
|||||||
if (action.type === EXPLORER_SEARCH[SUCCESS]) {
|
if (action.type === EXPLORER_SEARCH[SUCCESS]) {
|
||||||
return action.searchResult;
|
return action.searchResult;
|
||||||
}
|
}
|
||||||
|
if (action.type === EXPLORER_SEARCH[REQUEST]) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ function *doRequest(entity, serviceFn, payload) {
|
|||||||
|
|
||||||
function *searchExplorer(entity, payload) {
|
function *searchExplorer(entity, payload) {
|
||||||
let result;
|
let result;
|
||||||
|
const SEARCH_LIMIT = 100;
|
||||||
|
|
||||||
// Accounts
|
// Accounts
|
||||||
yield fetchAccounts({});
|
yield fetchAccounts({});
|
||||||
@ -30,7 +31,7 @@ function *searchExplorer(entity, payload) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Blocks
|
// Blocks
|
||||||
yield fetchBlocks({limit: 100});
|
yield fetchBlocks({limit: SEARCH_LIMIT});
|
||||||
const blocks = yield select(getBlocks);
|
const blocks = yield select(getBlocks);
|
||||||
const intSearchValue = parseInt(payload.searchValue, 10);
|
const intSearchValue = parseInt(payload.searchValue, 10);
|
||||||
result = blocks.find(block => {
|
result = blocks.find(block => {
|
||||||
@ -42,7 +43,7 @@ function *searchExplorer(entity, payload) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Transactions
|
// Transactions
|
||||||
yield fetchTransactions({blockLimit: 100});
|
yield fetchTransactions({blockLimit: SEARCH_LIMIT});
|
||||||
const transactions = yield select(getTransactions);
|
const transactions = yield select(getTransactions);
|
||||||
result = transactions.find(transaction => {
|
result = transactions.find(transaction => {
|
||||||
return transaction.hash === payload.searchValue;
|
return transaction.hash === payload.searchValue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user