Page MenuHomePhabricator

[Cashtab] redirect to wallet tab on send
AbandonedPublic

Authored by kieran709 on Jan 11 2022, 19:05.

Details

Reviewers
bytesofman
emack
Group Reviewers
Restricted Project
Summary

Added a function which redirects user back to wallet tab on sending XEC. If it works and we like it, I can also add this function to SendToken.js in another diff. Related to task T2076.

Test Plan

cd web/cashtab
npm start
navigate to send tab
send XEC
ensure transaction goes through, and that following a successful transaction, the user is redirected to the wallet tab.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
redirect-on-send
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17889
Build 35604: Build Diffcashtab-tests
Build 35603: arc lint + arc unit

Event Timeline

I think Cashtab is better without this feature for now. It's weird to implement and I don't think there is significant user demand. Reducing the load time after a tx is sent is much higher ROI. Once that is smaller, this is also easier to implement.

Abandon for now.

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

Here is where Cashtab is currently resetting loading status to false. We don't want the app to come out of UI lock until the utxo set has been updated following the transaction.

So, implementing this redirect is a little more complicated. The approach taken in this diff (just set loading to false after the tx is sent) "works," except if you try to quickly send another tx you will get a utxo error as the app has not yet loaded the updated utxo set.

To properly implement this redirect, we need to make sure that the utxo set has been updated after a successfully sent tx before the redirect is fired. One way to do this would be to have some kind of flag variable in state, userSentTx. Then , in this useEffect loop, check `if (userSentTx) {history.push('/')}

I'm not sure this sort of complication is worth the debatable UI improvement.

This revision now requires changes to proceed.Jan 11 2022, 19:30