keep-network / tbtc-dapp

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

Automatic wallet modal #363

Closed ironng closed 3 years ago

ironng commented 3 years ago

The "Connect to a wallet" modal will be shown whenever web3 is required to take action - on the start pages for deposit and redemption and any route that is wrapped in the <Loadable> component. This changes the <ConnectWalletDialog> state to be controlled by redux state rather than React state.

ironng commented 3 years ago

I found a small issue. There are warnings being thrown though testing the flows worked fine (I should have opened the browser console 😝 while testing) . Don't merge yet 😬

ironng commented 3 years ago

Hoookay. 😅 Ready to roll here.

Shadowfiend commented 3 years ago

Hmmm… This is still bringing up the Metamask modal when the redeem page comes up, rather than when the redeem button gets clicked on that page (i.e., http://localhost:3000/redeem shows it immediately, rather than showing it after going to http://localhost:3000/redeem, filling in the two fields, then clicking Redeem).

How hard do we think it would be to make the version with the later modal work?

ironng commented 3 years ago

It shouldn't be hard - we just need to move the action and condition into the Redeem button click handler.

ironng commented 3 years ago

Updated to only show the wallet modal after clicking Redeem :)