Avoid to remove the current loaded safe data if the batch request fail (#1847)

Co-authored-by: nicolas <nicosampler@users.noreply.github.com>
Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm>
This commit is contained in:
Agustin Pane 2021-02-24 13:54:48 -03:00 committed by GitHub
parent 870509eecf
commit ce1ab8b039
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,13 +122,16 @@ export const checkAndUpdateSafe = (safeAdd: string) => async (dispatch: Dispatch
name: localSafe?.name,
modules,
spendingLimits,
nonce: Number(remoteNonce),
threshold: Number(remoteThreshold),
nonce: remoteNonce ? Number(remoteNonce) : undefined,
threshold: remoteThreshold ? Number(remoteThreshold) : undefined,
featuresEnabled: localSafe?.currentVersion ? enabledFeatures(localSafe.currentVersion) : localSafe?.featuresEnabled,
}
dispatch(updateSafe(updatedSafe))
if (!remoteOwners.length) {
return
}
// If the remote owners does not contain a local address, we remove that local owner
localOwners.forEach((localAddress) => {
const remoteOwnerIndex = remoteOwners.findIndex((remoteAddress) => sameAddress(remoteAddress, localAddress))