Merge pull request #189 from cosmos/fix/redirect-default-chain

Add default chain cosmoshub
This commit is contained in:
Abel Fernández 2024-01-03 10:49:39 +01:00 committed by GitHub
commit 678aef8632
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,12 @@ export const ChainsProvider = ({ children }: ChainsProviderProps) => {
setChainsError(dispatch, chainItemsError);
const loadedChain = getChain(chainItems);
setChain(dispatch, loadedChain);
if (chainItems.mainnets.size && loadedChain === emptyChain) {
setChain(dispatch, chainItems.mainnets.get("cosmoshub") ?? emptyChain);
} else {
setChain(dispatch, loadedChain);
}
}, [chainItems, chainItemsError]);
useEffect(() => {