Skip to content

Commit

Permalink
Merge pull request #189 from cosmos/fix/redirect-default-chain
Browse files Browse the repository at this point in the history
Add default chain cosmoshub
  • Loading branch information
abefernan authored Jan 3, 2024
2 parents 6a91080 + 6c997f5 commit 678aef8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion context/ChainsContext/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

1 comment on commit 678aef8

@vercel
Copy link

@vercel vercel bot commented on 678aef8 Jan 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.