Page MenuHomePhabricator

[Cashtab] Route to onboarding if no wallet present
ClosedPublic

Authored by kieran709 on Jun 6 2022, 16:28.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABC5aea9cadfd90: [Cashtab] Route to onboarding if no wallet present
Summary

Related to T2090. Users should not be able to navigate to a component other than OnBoarding.js before creating a wallet. Logic has been added to routes which could previously be accessed before importing/creating a wallet, making it so the user can only see the OnBoarding component.

Test Plan

cd web/cashtab && npm start
navigate to localhost:3000 in a private browser
enter the following Routes:
/tokens
/airdrop
/configure
/send

Observe that if there is no wallet present, these routes will bring the user to the OnBoarding component.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bytesofman requested changes to this revision.Jun 6 2022, 16:37

Looks good.

After seeing this approach though, let's keep the <OnBoarding/> component in Home.js

Issue is -- user with a wallet will still see the Onboard.js screen flash before the wallet loads, which is not acceptable UX.

This revision now requires changes to proceed.Jun 6 2022, 16:37

Responding to review feedback

bytesofman requested changes to this revision.Jun 6 2022, 20:48
bytesofman added inline comments.
web/cashtab/extension/src/components/App.js
265 ↗(On Diff #33834)

Need to revert this as well, back to simply <Home/> with no conditional rendering

web/cashtab/src/components/App.js
282 ↗(On Diff #33834)

<Home />

This revision now requires changes to proceed.Jun 6 2022, 20:48

Responding to review feedback

This revision is now accepted and ready to land.Jun 6 2022, 22:26

Getting into some upgrades for cashtab-components. I overlooked that this approach prevents using URLs from outside Cashtab from reaching any screens other than the home page, as wallet is always false when the app first loads.

Need to put some more thought into how this is handled. For now, this current bug is worse than the edge case of "user may be confused if they navigate to the Configure page before creating a wallet," so I'm going to revert this.