fix: typos and types

This commit is contained in:
fernandomg 2020-05-22 23:48:24 -03:00
parent 5a02cbfc9a
commit 92ad62800e
4 changed files with 7 additions and 8 deletions

View File

@ -151,8 +151,7 @@ const createTransaction = ({
pendingExecutionKey = showSnackbar(notificationsQueue.pendingExecution, enqueueSnackbar, closeSnackbar) pendingExecutionKey = showSnackbar(notificationsQueue.pendingExecution, enqueueSnackbar, closeSnackbar)
await saveTxToHistory({ ...txArgs, txHash, origin }) await Promise.all([saveTxToHistory({ ...txArgs, txHash, origin }), storeTx(mockedTx, safeAddress, dispatch)])
await storeTx(mockedTx, safeAddress, dispatch)
dispatch(fetchTransactions(safeAddress)) dispatch(fetchTransactions(safeAddress))
} catch (e) { } catch (e) {
removeTxFromStore(mockedTx, safeAddress, dispatch) removeTxFromStore(mockedTx, safeAddress, dispatch)

View File

@ -27,7 +27,7 @@ export default handleActions(
// as we assume that this is the newest tx returned by the server // as we assume that this is the newest tx returned by the server
map.setIn(keyPath, updateTx) map.setIn(keyPath, updateTx)
} else { } else {
// if there's no confirmations, we assume this is a mocked tx // if there are no confirmations, we assume this is a mocked tx
// as txs without confirmation are not being returned by the server (?has_confirmations=true) // as txs without confirmation are not being returned by the server (?has_confirmations=true)
map.mergeDeepIn(keyPath, updateTx) map.mergeDeepIn(keyPath, updateTx)
} }

View File

@ -30,7 +30,7 @@ export default handleActions(
// as we assume that this is the newest tx returned by the server // as we assume that this is the newest tx returned by the server
txsList.update(storedTxIndex, () => updateTx) txsList.update(storedTxIndex, () => updateTx)
} else { } else {
// if there's no confirmations, we assume this is a mocked tx // if there are no confirmations, we assume this is a mocked tx
// as txs without confirmation are not being returned by the server (?has_confirmations=true) // as txs without confirmation are not being returned by the server (?has_confirmations=true)
txsList.update(storedTxIndex, (storedTx) => storedTx.mergeDeep(updateTx)) txsList.update(storedTxIndex, (storedTx) => storedTx.mergeDeep(updateTx))
} }

View File

@ -1,4 +1,4 @@
import { List, Set } from 'immutable' import { List, Map, Set } from 'immutable'
import { matchPath } from 'react-router-dom' import { matchPath } from 'react-router-dom'
import { createSelector } from 'reselect' import { createSelector } from 'reselect'
@ -79,14 +79,14 @@ export const safeCancellationTransactionsSelector = createSelector(
safeParamAddressFromStateSelector, safeParamAddressFromStateSelector,
(cancellationTransactions, address) => { (cancellationTransactions, address) => {
if (!cancellationTransactions) { if (!cancellationTransactions) {
return List([]) return Map()
} }
if (!address) { if (!address) {
return List([]) return Map()
} }
return cancellationTransactions.get(address) || List([]) return cancellationTransactions.get(address) || Map({})
}, },
) )