Fix typo in ADD_OR_UPDATE_SAFE reducer (#1735)

This commit is contained in:
Daniel Sanchez 2020-12-16 22:32:13 +01:00 committed by GitHub
parent f47580877b
commit f143721c06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -107,17 +107,18 @@ export default handleActions(
[ADD_OR_UPDATE_SAFE]: (state: SafeReducerMap, action) => {
const { safe } = action.payload
const safeAddress = safe.address
if (!state.hasIn(['safes', safe.address])) {
return state.setIn(['safes', safe.address], makeSafe(safe))
if (!state.hasIn(['safes', safeAddress])) {
return state.setIn(['safes', safeAddress], makeSafe(safe))
}
const shouldUpdate = shouldSafeStoreBeUpdated(safe, state.getIn(['safes', safe.safeAddress]))
const shouldUpdate = shouldSafeStoreBeUpdated(safe, state.getIn(['safes', safeAddress]))
return shouldUpdate
? state.updateIn(
['safes', safe.address],
makeSafe({ name: safe?.name || 'LOADED SAFE', address: safe.address }),
['safes', safeAddress],
makeSafe({ name: safe?.name || 'LOADED SAFE', address: safeAddress }),
(prevSafe) => updateSafeProps(prevSafe, safe),
)
: state