1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Await forceUpdateMetamaskState (#8422)

`forceUpdateMetamaskState` was being called in various action creators
without `await`. Each action creator now waits for the state update to
complete before continuing.
This commit is contained in:
Mark Stacey 2020-04-27 16:36:19 -03:00 committed by GitHub
parent ee3f6f124e
commit 65ad3ba9e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -318,7 +318,7 @@ export function addNewAccount () {
}
const newAccountAddress = Object.keys(newIdentities).find((address) => !oldIdentities[address])
dispatch(hideLoadingIndication())
forceUpdateMetamaskState(dispatch)
await forceUpdateMetamaskState(dispatch)
return newAccountAddress
}
}
@ -338,7 +338,7 @@ export function checkHardwareStatus (deviceName, hdPath) {
}
dispatch(hideLoadingIndication())
forceUpdateMetamaskState(dispatch)
await forceUpdateMetamaskState(dispatch)
return unlocked
}
}
@ -356,7 +356,7 @@ export function forgetDevice (deviceName) {
}
dispatch(hideLoadingIndication())
forceUpdateMetamaskState(dispatch)
await forceUpdateMetamaskState(dispatch)
}
}
@ -374,7 +374,7 @@ export function connectHardware (deviceName, page, hdPath) {
throw error
}
dispatch(hideLoadingIndication())
forceUpdateMetamaskState(dispatch)
await forceUpdateMetamaskState(dispatch)
return accounts
}
@ -1074,7 +1074,7 @@ export function markPasswordForgotten () {
// TODO: handle errors
dispatch(hideLoadingIndication())
dispatch(forgotPassword())
forceUpdateMetamaskState(dispatch)
await forceUpdateMetamaskState(dispatch)
}
}
}