-
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
Refactor send page state management #10965
Conversation
07015e4
to
d9d759a
Compare
Builds ready [d9d759a]
Page Load Metrics (776 ± 51 ms)
|
...ponents/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js
Show resolved
Hide resolved
...ponents/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js
Outdated
Show resolved
Hide resolved
0aac00b
to
e19e5d9
Compare
b284d46
to
294b8c6
Compare
294b8c6
to
60a4eee
Compare
ui/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js
Show resolved
Hide resolved
ui/pages/send/send-content/add-recipient/add-recipient.component.test.js
Outdated
Show resolved
Hide resolved
Builds ready [8ef1d5e]
Page Load Metrics (601 ± 42 ms)
|
Builds ready [7209ec6]
Page Load Metrics (613 ± 52 ms)
|
Everything looks good to me! I can re-review after the rebase |
581597d
to
849ca6a
Compare
Builds ready [849ca6a]
Page Load Metrics (673 ± 56 ms)
|
@@ -2738,6 +2723,16 @@ export function estimateGas(params) { | |||
return promisifiedBackground.estimateGas(params); | |||
} | |||
|
|||
export async function updateTokenType(tokenAddress) { | |||
let token = {}; | |||
try { |
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.
Guess you felt loading indicator wasn't required here?
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.
its handled at the callsite now, the loading indicator is shown anytime we updateAsset to a token asset.
Builds ready [f7bb6c3]
Page Load Metrics (569 ± 46 ms)
|
@@ -44,6 +44,7 @@ import { | |||
hideLoadingIndication, | |||
showConfTxPage, | |||
showLoadingIndication, | |||
updateTokenType, |
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.
So while trying to test this I re-found an issue similar to one I had been having while trying to tack a PR on top of the broad send-slice refactor.
Here it is, so entering the send flow the form status is immediately set to valid:
once, however, I click the dropdown to select another token, the form becomes invalid:
That is expected, but then I cannot get the form status to be valid again:
even if I go back and select Eth as the send asset:
I believe it has something to do with sequencing of actions and the gas loading thunk. The last call to validateSendState sets us to invalid here.
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.
can you try 3d8ca2d out for a spin? see if the issue persists?
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.
@brad-decker That commit seems to have fixed the issue, 🚀
@@ -843,6 +845,10 @@ const slice = createSlice({ | |||
): | |||
state.status = SEND_STATUSES.INVALID; | |||
break; | |||
case state.asset.type === ASSET_TYPES.TOKEN && |
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.
not req but wondering if it makes sense to separate this out so that asset has an error field, as we do with amount and gas?
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 was thinking that when I was working through erc721 updates, i think its a definite candidate for an improvement but not to be handled here.
Builds ready [3d8ca2d]
Page Load Metrics (614 ± 52 ms)
|
LGTM! |
Builds ready [0320dff]
Page Load Metrics (560 ± 33 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.
LGTM!
@@ -1,7 +1,7 @@ | |||
import { connect } from 'react-redux'; |
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.
At some point - not in this PR - we should consider renaming some of these files/components/containers that refer to ether towards more chain-agnostic language, like you do throughout this PR
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.
Tested this a bunch and the code looks good! Let's gooooooo!
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.
Amazing work Brad! LGTM
Refactor Send Page State Management
Problem Statements
Design goals of refactor