dataxfi / dapp

DataX Dapp Frontend
dapp-olive.vercel.app
0 stars 0 forks source link

Proper Error handling for unsupported network #5

Closed 0xMageX closed 2 years ago

0xMageX commented 3 years ago

TL;DR

Dapp must show 'Unknown' whenever unsupported network is selected in Web3 wallet (like Metamask). 33

Problem

Dapp shows 'Rinkeby' as default network whenever unsupported network is selected.

Solution

Dapp should show 'Unknown' whenever unsupported network is selected.

Comment

This probably should be solved in datax.js since default configuration comes from Config.ts in datax.js Check here

keithfrazier98 commented 3 years ago

Issue fixed by commit b6cc903f21cf060115127862334a98b2afabd9e8

0xMageX commented 2 years ago

@keithfrazier98 I am still seeing "Rinkeby" when I choose unknown network. I guess just changing 'default' value in lib isn't enough. One of the ways it can be solved is to write a utility component/function/HOC that detects the current network and renders components accordingly. HOC can be middleware or function can be called within useEffect()

(e.g.) If detected network is supported, show normal flow - Tradex, StakeX and other screens. If detected network is unsupported, show "Error page"

0xMageX commented 2 years ago

Just tested again. It works now 👍 Closing the issue