From 12284a5fc26af796df7326293ed67ce27fb518ff Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Tue, 4 Sep 2018 13:51:33 -0400 Subject: [PATCH] add noLoading flag in action to not show loader --- embark-ui/src/actions/index.js | 2 +- embark-ui/src/reducers/index.js | 2 +- embark-ui/src/sagas/index.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/embark-ui/src/actions/index.js b/embark-ui/src/actions/index.js index 0eb5e5e0..4c55e7d6 100644 --- a/embark-ui/src/actions/index.js +++ b/embark-ui/src/actions/index.js @@ -113,7 +113,7 @@ export const contractFile = { export const CONTRACT_FUNCTION = createRequestTypes('CONTRACT_FUNCTION'); 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}]}), failure: (error) => action(CONTRACT_FUNCTION[FAILURE], {error}) }; diff --git a/embark-ui/src/reducers/index.js b/embark-ui/src/reducers/index.js index 63d6da7c..21a63e8f 100644 --- a/embark-ui/src/reducers/index.js +++ b/embark-ui/src/reducers/index.js @@ -134,7 +134,7 @@ function errorEntities(state = {}, action) { } function loading(_state = false, action) { - return action.type.endsWith(REQUEST); + return action.type.endsWith(REQUEST) && !action.noLoading; } const rootReducer = combineReducers({ diff --git a/embark-ui/src/sagas/index.js b/embark-ui/src/sagas/index.js index 43fae936..2ce44d52 100644 --- a/embark-ui/src/sagas/index.js +++ b/embark-ui/src/sagas/index.js @@ -172,8 +172,8 @@ export function *initBlockHeader() { const channel = yield call(createChannel, socket); while (true) { yield take(channel); - yield put({type: actions.BLOCKS[actions.REQUEST]}); - yield put({type: actions.TRANSACTIONS[actions.REQUEST]}); + yield put({type: actions.BLOCKS[actions.REQUEST], noLoading: true}); + yield put({type: actions.TRANSACTIONS[actions.REQUEST], noLoading: true}); } }