MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
11.52k stars 4.7k forks source link

fix: reset to native asset on account change #24398

Closed bergeron closed 1 week ago

bergeron commented 1 week ago

Description

Fixes an issue when you changed accounts while sending an NFT. It would keep the NFT asset, even though the new account doesn't own it. Reset to the native asset instead.

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/metamask-extension/issues/24391

Manual testing steps

  1. Prepare a transaction to send an NFT
  2. Before clicking Next, change accounts
  3. It should reset to ETH/native token.

Screenshots/Recordings

Before

https://github.com/MetaMask/metamask-extension/assets/3500406/7628c507-a694-4bf9-8d1b-e828f7a8cdc7

After

https://github.com/MetaMask/metamask-extension/assets/3500406/1ac60586-cf97-47bc-9f4e-1e518b8a053b

Pre-merge author checklist

Pre-merge reviewer checklist

github-actions[bot] commented 1 week ago

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.

sahar-fehri commented 1 week ago

Thnx for the fix! 🙏

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 67.38%. Comparing base (291a642) to head (0195d92). Report is 3 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #24398 +/- ## =========================================== + Coverage 67.37% 67.38% +0.01% =========================================== Files 1284 1284 Lines 50025 50020 -5 Branches 12987 12985 -2 =========================================== + Hits 33701 33705 +4 + Misses 16324 16315 -9 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.