You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A useState hook explicitly for refreshing is used after new values for _ORDERBOOK_CACHE are fetched via websockets. Ideally the orderbook data itself should be stored in useState(); that way updating this value will automatically refresh the UI.
Secondly there's double fetching of same data
Websocket listens to changes in bid or asks, then calls setRefesh(). The fetched value is discarded, the only purpose of this was to update the UI again.
The bid and ask data is fetched again using a useAsync hook
This should be resolved by the mentioned solution.
The text was updated successfully, but these errors were encountered:
Currently
context/Dex.ts
andcontext/Token.ts
use a hacky approach to update state.swap-ui/src/context/Dex.tsx
Line 227 in 4a92cad
A
useState
hook explicitly for refreshing is used after new values for_ORDERBOOK_CACHE
are fetched via websockets. Ideally the orderbook data itself should be stored inuseState()
; that way updating this value will automatically refresh the UI.Secondly there's double fetching of same data
setRefesh()
. The fetched value is discarded, the only purpose of this was to update the UI again.useAsync
hookThis should be resolved by the mentioned solution.
The text was updated successfully, but these errors were encountered: