-
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
fix: nonce increment/decrement functionality using arrow buttons #26569
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
@@ -431,6 +430,19 @@ export default class ConfirmTransactionBase extends Component { | |||
); | |||
}; | |||
|
|||
const handleNonceChange = ({ target: { value } }) => { |
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.
Minor, do we want a useCallback
just in case?
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.
100% we need to use the usaCallback
, but in this case, it is an old class component.
const inputValue = Number(value); | ||
|
||
if (inputValue < 0 || isNaN(inputValue)) { | ||
updateCustomNonce(''); |
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.
Would it be cleaner to set this to undefined
to be explicit as we already have the fallback on 533?
return; | ||
} | ||
|
||
updateCustomNonce(String(inputValue)); |
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.
Assuming the inputValue
is a decimal and not hexadecimal, why are we storing it as a string?
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.
Good point, no need to store it as a string, removed.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #26569 +/- ##
===========================================
+ Coverage 70.13% 70.13% +0.01%
===========================================
Files 1424 1424
Lines 49567 49571 +4
Branches 13867 13867
===========================================
+ Hits 34759 34765 +6
+ Misses 14808 14806 -2 ☔ View full report in Codecov by Sentry. |
Builds ready [2e30805]
Page Load Metrics (90 ± 9 ms)
Bundle size diffs
|
Works great! increments.mov |
Builds ready [8cbf8be]
Page Load Metrics (83 ± 13 ms)
Bundle size diffs
|
Quality Gate passedIssues Measures |
Builds ready [a9b1358]
Page Load Metrics (1884 ± 91 ms)
Bundle size diffs
|
Description
Context
When customizing the nonce using a lower increment button nonce value is set to 0, using higher increment button results in nonce = 1.
This PR aims to fix the support of the arrow buttons to increase/decrease the number taking the suggested next nonce as the base.
Related issues
Fixes: #23535
Manual testing steps
Screenshots/Recordings
Before
After
Screencast.from.21-08-2024.10.42.17.webm
Pre-merge author checklist
Pre-merge reviewer checklist