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

[Bug]: Switching Account During NFT Send Doesn't Clear NFT as Send Asset #24391

Closed darkwing closed 1 week ago

darkwing commented 1 week ago

Describe the bug

Presently the Account Picker is enabled during the Send flow. When sending a NFT and switching account mid-send-flow, the asset picker still shows the NFT as the asset to send. Thus, the user appears to be able to send an NFT from another account.

Expected behavior

The NFT should be cleared from the AssetPicker and probably the native currency should become the asset to send, with a value of 0

Screenshots/Recordings

https://github.com/MetaMask/metamask-extension/assets/46655/021c71aa-6221-48bc-bc43-309b5573e147

Steps to reproduce

  1. Choose account 1 which has an NFT
  2. Choose the NFTs tab, click on the NFT
  3. Click on the Send button
  4. Choose a recipient
  5. Switch to account 2
  6. BUG: see the NFT still in the account picker

Error messages or log output

No response

Version

develop

Build type

None

Browser

Chrome

Operating system

MacOS

Hardware wallet

No response

Additional context

No response

Severity

No response

darkwing commented 1 week ago

I recommend looking at ui/ducks/send/send.js with regard to SELECTED_ACCOUNT_CHANGED