Page MenuHomePhabricator

[Cashtab] Lock full UI when utxo set is loading after send
ClosedPublic

Authored by bytesofman on Aug 12 2021, 22:59.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCe0c13cd522af: [Cashtab] Lock full UI when utxo set is loading after send
Summary

T1720

Right now the app is set to lock the UI on the Send and SendToken screens while the utxo set is refreshing. However, the user may still click off the Send or SendToken screen and then navigate back. This could allow the user to send a transaction with an invalid utxo set. The transaction won't actually send, they will get an error msg, but it's confusing and not great UX.

This diff locks the nav bar while the utxo set refreshes.

Test Plan

npm start, send an XEC transaction, notice that the nav bar is locked, send an eToken transaction, notice the nav bar is locked

Diff Detail

Repository
rABC Bitcoin ABC
Branch
universal-app-loading-param
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16313
Build 32491: Build Diffcashtab-tests
Build 32490: arc lint + arc unit

Event Timeline

Fabien requested changes to this revision.Aug 13 2021, 07:17
Fabien added a subscriber: Fabien.
Fabien added inline comments.
web/cashtab/src/components/Send/Send.js
554

Looks like debug stuff that needs to be removed

web/cashtab/src/components/Send/SendToken.js
451

Dito

web/cashtab/src/components/Send/__tests__/Send.test.js
120

?

This revision now requires changes to proceed.Aug 13 2021, 07:17
bytesofman added inline comments.
web/cashtab/src/components/Send/Send.js
554

This was necessary to pass the unit tests in Send.test.js. Otherwise, the <Send/> component receives to prop for this, lacks a default, and will throw a passLoadingStatus is not a function error.

I chose status => {console.log(status)} as a simple function that passes a parameter. It is only used in the unit tests.

web/cashtab/src/components/Send/SendToken.js
451

Same as previous reply. Ultimately, every component will need to have this kind of props validation. It's an oversight that it is not universally included; task is open for it.

This one is a bit weird since the default is just a stub function that is only ever used in the unit tests.

web/cashtab/src/components/Send/__tests__/Send.test.js
120

Looks like this is leftover from some of the alternative approaches I tried to help the unit tests recognize the passLoadingStatus param, will take it out.

web/cashtab/src/components/Send/Send.js
554

OK, can you add a comment in the code to explain this ? This is far from obvious and will prevent from getting cleaned up unexpectedly.

Add comments explaining stub function defaultProps for Send and SendToken

This revision is now accepted and ready to land.Aug 13 2021, 18:48