Skip to content

Commit

Permalink
build: bump
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Mar 12, 2024
1 parent 1501e3b commit 93d10e5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yearn-finance/web-lib",
"version": "3.0.179",
"version": "3.0.180",
"main": "./dist/index.js",
"types": "./dist/index.d.js",
"files": [
Expand Down
17 changes: 12 additions & 5 deletions src/components/ModalMobileMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, {cloneElement, Fragment, useEffect, useMemo, useRef, useState} fro
import {useAccount, useConnect} from 'wagmi';
import {useWeb3} from '@builtbymom/web3/contexts/useWeb3';
import {truncateHex} from '@builtbymom/web3/utils/tools.address';
import {retrieveConfig} from '@builtbymom/web3/utils/wagmi';
import {getConfig, retrieveConfig} from '@builtbymom/web3/utils/wagmi';
import {Dialog, Transition} from '@headlessui/react';

import {useInjectedWallet} from '../hooks/useInjectedWallet';
Expand All @@ -18,6 +18,7 @@ type TModalMobileMenu = {
shouldUseNetworks: boolean;
onClose: () => void;
children: ReactNode;
supportedNetworks: Chain[];
};

function Modal(props: TModal): ReactElement {
Expand Down Expand Up @@ -82,10 +83,16 @@ export function ModalMobileMenu(props: TModalMobileMenu): ReactElement {

const supportedNetworks = useMemo((): TNetwork[] => {
connectors; //Hard trigger re-render when connectors change
const config = retrieveConfig();
const noFork = config.chains.filter(({id}): boolean => id !== 1337);
return noFork.map((network: Chain): TNetwork => ({value: network.id, label: network.name}));
}, [connectors]);
try {
const config = retrieveConfig();
const noFork = config.chains.filter(({id}): boolean => id !== 1337);
return noFork.map((network: Chain): TNetwork => ({value: network.id, label: network.name}));
} catch (error) {
const config = getConfig({chains: props.supportedNetworks});
const noFork = config.chains.filter(({id}): boolean => id !== 1337);
return noFork.map((network: Chain): TNetwork => ({value: network.id, label: network.name}));
}
}, [connectors, props.supportedNetworks]);

useEffect((): void => {
if (!isActive && address) {
Expand Down

0 comments on commit 93d10e5

Please sign in to comment.