-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use send
state for send flow token
#8695
Conversation
Builds ready [c177e0e]
Page Load Metrics (911 ± 51 ms)
|
a04c9cc
to
2d3f2ea
Compare
Builds ready [2d3f2ea]
Page Load Metrics (716 ± 74 ms)
|
The chosen token in the `send` flow was set from one of two places: `metamask.selectedTokenAddress` or `metamask.send.token`. The former is used most of the time, but the latter is used for the 'Edit' button shown in the upper-left of the confirmation UI. The send flow will now exclusively use `metamask.send.token` for the token state during the send flow. `metamask.selectedTokenAddress` is now only used for the selected token state on the Home screen. This simplifies the Redux state, as the send token is now in one place instead of two, and `metamask.selectedTokenAddress` has only one purpose.
2d3f2ea
to
091e782
Compare
Builds ready [091e782]
Page Load Metrics (615 ± 39 ms)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes herein look great, but we should probably take the opportunity to undo a grievous injury to the English language.
@@ -55,7 +55,7 @@ describe('add-recipient utils', function () { | |||
}) | |||
}) | |||
|
|||
it('should null if to is truthy part of tokens but selectedToken falsy', function () { | |||
it('should null if to is truthy part of tokens but sendToken falsy', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR did not commit the original sin here, but what the hell is this test description?
Ditto for the other cases in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/giphy say what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started addressing this, but it got bigger than I had anticipated. I'll address this separately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been addressed in #8705
@@ -38,7 +38,6 @@ const mapDispatchToProps = (dispatch) => { | |||
toNumericBase: 'hex', | |||
}) | |||
|
|||
dispatch(setSelectedToken(tokenAddress)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this was removed because its purpose was to set the token correctly on the edit screen, and that's handled now by the token
below being passed to updateSend
.
Builds ready [f62d43c]
Page Load Metrics (612 ± 61 ms)
|
* origin/develop: (689 commits) Implement asset page (#8696) fix crash on signature request (#8709) Fix accounts menu styling (#8707) Delete docs/porting_to_new_environment.md (#8704) Remove unused `getToErrorObject` parameters (#8705) hide connected-status on metamask ext (#8703) Stop adding permissions middleware to trusted connections (#8701) Use `send` state for send flow token (#8695) do not display extension id in connection modal (#8699) Fix tab content disappearing during scrolling on macOS Firefox (#8702) close details when button is pressed (#8694) Refactor token selectors (#8671) Update eth_accounts permission description (#8693) Extract selected token from token input (#8692) Fix propType for Home defaultHomeActiveTabName (#8683) Fix create account form styling (#8689) Remove unused `getSelectedTokenAssetImage` selector (#8691) Remove `getTxParams` (#8676) do not show account mismatch alert on details (#8678) Fix connect hardware styling (#8680) ...
The chosen token in the
send
flow was set from one of two places:metamask.selectedTokenAddress
ormetamask.send.token
. The former is used most of the time, but the latter is used for the 'Edit' button shown in the upper-left of the confirmation UI.The send flow will now exclusively use
metamask.send.token
for the token state during the send flow.metamask.selectedTokenAddress
is now only used for the selected token state on the Home screen. This simplifies the Redux state, as the send token is now in one place instead of two, andmetamask.selectedTokenAddress
has only one purpose.