sygmaprotocol / sygma-widget

Transfer widget for the sygmaprotocol
5 stars 2 forks source link

fix: Switching to a different TOKEN mapping for "From - TO" relationship is not updated in UI if amount is inserted #160

Closed saadjhk closed 3 months ago

saadjhk commented 3 months ago

Description

Resource selection is not updated on UI when a destination network is changed.

Related Issue Or Context

https://github.com/sygmaprotocol/sygma-widget/issues/117

When destination network is changed by the user IMO the resource selected, amount and destination address need to be reset so that they may update the UI with correct values. I have added functionality that resets the selected resource, which compels user to select the desired token again. Furthermore, the address input should be cleared if the source network is of type EVM however, potential destination is of a different type

Closes: #117

Types of changes

wainola commented 3 months ago

@saadjhk if I change source network, the selectors allows me to have unsoported routes, like Cronos - Cronos. Also if I swtich the network from the selector which in turns triggers switching in metamask, the destination selector doesn't get updated correctly. I have the impression part of the changes here undo some fixes that were merge on main. Can you confirm this? Is this expected?