keep-network / tbtc-dapp

Deposit BTC and redeem TBTC
http://dapp.test.tbtc.network/
MIT License
33 stars 31 forks source link

Enable additional urls for better restarts #224

Closed ironng closed 4 years ago

ironng commented 4 years ago

Fills in missing urls in both the deposit and redemption flows. These urls already existed but were not in use. Addresses the first part of #218.

In the deposit flow, this enables:

The GetAddress component is now wrapped in a <Loadable/> component wrapper and calls a new action getBitcoinAddress (split out from the requestDeposit saga) to allow the /get-address route restart the deposit flow in case the user refreshes the page.

This also splits out a new Confirming component out of the Pay component for the deposit flow to match the url and make it a little easier to read (the original Pay component had a lot of conditional logic for rendering).

In the redemption flow:

Lastly, this also PR fixes a bit of linting and adds redux devtools for easier debugging. There is a new .git-blame-ignore-revs file to help out with history.

ironng commented 4 years ago

@Shadowfiend 😞 I found that 2a4e0c6 caused a regression, so I'm reverting it here 984eb3c in the next branch.

Shadowfiend commented 4 years ago

Mmm, guessing this is related to the call we were talking about moving out of the component?

ironng commented 4 years ago

I also thought that might be the case, so I tested the flow after taking actions out the component and making sure the correct logic only ran once, but the bug still occurred. Maybe it has to do with trying to get the current state of the deposit too early after it was just created? (In the new branch, I'm still removing actions from view logic (of course, unless necessary, like for a button) but leaving that flag in the reducer to avoid this bug).