Browse Source

Minor fixes

develop
Ezerous 4 years ago
parent
commit
02432887d0
  1. 1
      src/blocks/blocksSaga.js
  2. 5
      src/drizzle/drizzleStatusSaga.js
  3. 20
      src/transactions/transactionStackReducer.js

1
src/blocks/blocksSaga.js

@ -1,6 +1,7 @@
import { END, eventChannel } from 'redux-saga'
import { all, call, put, take, takeEvery, takeLatest } from 'redux-saga/effects'
import * as BlocksActions from './blockActions'
import * as ContractActions from '../contracts/constants'
/*
* Listen for Blocks

5
src/drizzle/drizzleStatusSaga.js

@ -54,17 +54,14 @@ export function * initializeDrizzle (action) {
}
yield put({ type: BlocksActions.BLOCKS_LISTENING, drizzle, web3 })
yield put({ type: DrizzleActions.DRIZZLE_INITIALIZED, drizzle })
}
}
} catch (error) {
yield put({ type: DrizzleActions.DRIZZLE_FAILED, error })
console.error('Error initializing Drizzle:')
console.error(error)
return
}
yield put({ type: DrizzleActions.DRIZZLE_INITIALIZED })
}
function * drizzleStatusSaga () {

20
src/transactions/transactionStackReducer.js

@ -4,22 +4,26 @@ const initialState = []
const transactionStackReducer = (state = initialState, action) => {
if (action.type === TransactionsActions.PUSH_TO_TXSTACK) {
return [...state, action.stackTempKey]
return [...state, action.stackTempKey];
}
if (action.type === TransactionsActions.POP_FROM_TXSTACK) {
state.pop()
return [...state]
return [...state.slice(0, -1)];
}
if (action.type === TransactionsActions.TX_BROADCASTED) {
state[action.stackId] = action.txHash
return [...state]
return state.map((txHash, index) => {
if (index !== action.stackId) {
// This isn't the item we care about - keep it as-is
return txHash;
}
// Otherwise, this is the one we want - return an updated value
return action.txHash;
})
}
return state
return state;
}
export default transactionStackReducer

Loading…
Cancel
Save