status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.92k stars 984 forks source link

Swap button enabled and approval not shown after account switch on swap page #21441

Closed VolodLytvynenko closed 2 weeks ago

VolodLytvynenko commented 1 month ago

Problem:

After switching from Account 1 (which has enough assets and approved ERC-20 tokens) to Account 2 (which has fewer assets and non-approved ERC-20 tokens), the "Review Swap" button remains enabled, and the user can proceed to the confirmation page, even though Account 2 does not have enough assets to complete the transaction. Additionally, the approval button is not displayed for Account 2, despite the ERC-20 token being unapproved.

Steps:

1, Recover a user with two accounts:

Actual Result:

https://github.com/user-attachments/assets/057b5779-6608-4eb1-8362-17f73b973c45

Expected Result:

ENV:

Nightly 15 Oct 2024