add noLoading flag in action to not show loader

This commit is contained in:
Jonathan Rainville 2018-09-04 13:51:33 -04:00 committed by Pascal Precht
parent 7fa186b636
commit 7a4f1180cf
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
3 changed files with 4 additions and 4 deletions

View File

@ -113,7 +113,7 @@ export const contractFile = {
export const CONTRACT_FUNCTION = createRequestTypes('CONTRACT_FUNCTION'); export const CONTRACT_FUNCTION = createRequestTypes('CONTRACT_FUNCTION');
export const contractFunction = { export const contractFunction = {
post: (contractName, method, inputs, gasPrice) => action(CONTRACT_FUNCTION[REQUEST], {contractName, method, inputs, gasPrice}), post: (contractName, method, inputs, gasPrice) => action(CONTRACT_FUNCTION[REQUEST], {contractName, method, inputs, gasPrice, noLoading: true}),
success: (result, payload) => action(CONTRACT_FUNCTION[SUCCESS], {contractFunctions: [{...result, ...payload}]}), success: (result, payload) => action(CONTRACT_FUNCTION[SUCCESS], {contractFunctions: [{...result, ...payload}]}),
failure: (error) => action(CONTRACT_FUNCTION[FAILURE], {error}) failure: (error) => action(CONTRACT_FUNCTION[FAILURE], {error})
}; };

View File

@ -133,7 +133,7 @@ function errorEntities(state = {}, action) {
} }
function loading(_state = false, action) { function loading(_state = false, action) {
return action.type.endsWith(REQUEST); return action.type.endsWith(REQUEST) && !action.noLoading;
} }
function compilingContract(state = false, action) { function compilingContract(state = false, action) {

View File

@ -186,8 +186,8 @@ export function *initBlockHeader() {
const channel = yield call(createChannel, socket); const channel = yield call(createChannel, socket);
while (true) { while (true) {
yield take(channel); yield take(channel);
yield put({type: actions.BLOCKS[actions.REQUEST]}); yield put({type: actions.BLOCKS[actions.REQUEST], noLoading: true});
yield put({type: actions.TRANSACTIONS[actions.REQUEST]}); yield put({type: actions.TRANSACTIONS[actions.REQUEST], noLoading: true});
} }
} }