mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01: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:
parent
ee3f6f124e
commit
65ad3ba9e6
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user