Adds a new action to reset state when starting a deposit or redemption flow. The action is triggered in a useEffect so it should run on page load or when hitting the back button.
Also clears any errors from the state when the HISTORY_PUSH action occurs. Note this action only happens when the history is modified programmatically via navigateTo and not when the user hits the back button in the browser. We also try to clear errors when logical. For instance, the requestDepositError will be reset in the state when a new deposit request is sent.
Lastly, there is a little refactoring here to rewrite the Start component as a functional component.
Adds a new action to reset state when starting a deposit or redemption flow. The action is triggered in a
useEffect
so it should run on page load or when hitting the back button.Also clears any errors from the state when the
HISTORY_PUSH
action occurs. Note this action only happens when the history is modified programmatically vianavigateTo
and not when the user hits the back button in the browser. We also try to clear errors when logical. For instance, therequestDepositError
will be reset in the state when a new deposit request is sent.Lastly, there is a little refactoring here to rewrite the
Start
component as a functional component.