-
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
Remove default sendToken value in send.component.js #8764
Conversation
Builds ready [ee0acd4]
Page Load Metrics (585 ± 60 ms)
|
ui/app/pages/send/send.utils.js
Outdated
return BASE_TOKEN_GAS_COST | ||
} | ||
|
||
if (sendToken) { | ||
if (Object.keys(sendToken).length !== 0) { |
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.
Though if sendToken
is undefined
or null
this will throw now 🤔
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 suspect that this PR would fix the bug, but only because estimateGas
is never called with sendToken
set to null
or undefined
.
It's only called by updateGasData
in actions.js
, which itself is only called by updateAndSetGasLimit
in send.container.js
, which is only called in one spot in send.component.js
, where sendToken
is given a default value of {}
:
sendToken = {}, |
state.metamask.send.token
is always set to undefined
when there is no sendToken
, so that default should always be set. But only for a very tenuous reason.
It would seem better to remove the = {}
instead.
ee0acd4
to
fc6bc43
Compare
Builds ready [fc6bc43]
Page Load Metrics (695 ± 28 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!
Fixes #8763