Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Prevent unwanted
updateEditableParams
calls on send flow (#29048)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> This PR aims to prevent unwanted `updateEditableParams` calls in send flow when `useMaxValue` is settled. After investigating [Sentry error mentioned in the task](https://metamask.sentry.io/issues/5973118037/events/1ee3e017ad454f09b3666089fba3c2bd/?project=273505&referrer=previous-event) noticed `updateEditableParams` is throwing when `useMaxValue` is set to `true`. This issue is happening when we submit/cancel confirmation, component gets an update, `updateMaxValue - updateEditableParams` gets called but transaction is not `unapproved` state. So adding a condition to updating transaction value only when transaction is `unapproved` status, this will guarantee to prevent unwanted calls. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29048?quickstart=1) ## **Related issues** Fixes: #27742 ## **Manual testing steps** N/A ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** N/A ### **After** N/A ## **Pre-merge author checklist** - [X] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
- Loading branch information