First render our beautiful welcome page,
then run redirectIfOnboard():
Check for Metamask (if (web3) will do this. If you don't have Metamask, do the check, but spoof the variable as true or false for testing)
set ethAddr = web3.eth.accounts[0] - if you don't have Metamask, then spoof with ethAddr = '0x654321';
We will use ethAddr all through both flows, so if not using state, this must be passed from page to page.
function redirectIfOnboard() {
if (web3) {
ethAddr =web3.eth? web3.eth.accounts[0] : '0x654321';
/// route to phone number page
}}
For demo purposes set a listener for click anywhere on screen, which sets web3= true then calls redirectIfOnboard(). But comment out (don't delete) the listener once tested - we will use it for later testing.
First render our beautiful welcome page, then run redirectIfOnboard(): Check for Metamask (
if (web3)
will do this. If you don't have Metamask, do the check, but spoof the variable as true or false for testing) setethAddr = web3.eth.accounts[0]
- if you don't have Metamask, then spoof with ethAddr = '0x654321'; We will use ethAddr all through both flows, so if not using state, this must be passed from page to page.For demo purposes set a listener for click anywhere on screen, which sets
web3= true
then calls redirectIfOnboard(). But comment out (don't delete) the listener once tested - we will use it for later testing.