Merge pull request #46 from status-im/bug_fix/refresh-on-tx

Add flag to not refresh the page on certain request
This commit is contained in:
Iuri Matias 2018-09-04 13:54:59 -04:00 committed by GitHub
commit c0fdbd96d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 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})
};

View File

@ -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({

View File

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