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.
feature/default_network_editable
Mark Stacey 5 years ago committed by GitHub
parent ee3f6f124e
commit 65ad3ba9e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      ui/app/store/actions.js

@ -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…
Cancel
Save