This error comes from useModalTradeTokenList.tsx handleSelect which runs the onClick defined in useTradePairs and passed in ModalTradeTokenList via the data prop. Because there is no check that tradePair is valid, when pressing 'Enter' with an invalid search, there is an error.
Steps to reproduce:
Go to trade page
Open trade token selection modal
Type a combination of keys that yields no result, e.g. '13143124132'
Press 'Enter', see the error in the console
Expected
Go to trade page
Open trade token selection modal
Type a combination of keys that yields no result, e.g. '13143124132'
Press 'Enter', nothing happens, modal is not closed
Issue detected on Sentry:
https://bprotocol-foundation.sentry.io/issues/4554127820/?project=4505074572197888&query=is%3Aunresolved+issue.category%3Aerror&referrer=issue-stream&sort=user&statsPeriod=30d&stream_index=5
This error comes from useModalTradeTokenList.tsx handleSelect which runs the onClick defined in
useTradePairs
and passed inModalTradeTokenList
via thedata
prop. Because there is no check that tradePair is valid, when pressing 'Enter' with an invalid search, there is an error.Steps to reproduce:
Expected