Skip to content

Commit

Permalink
fix: blank page because the app was crashing, due to having 2 ListUpd… (
Browse files Browse the repository at this point in the history
  • Loading branch information
albertfolch-redeemeum authored Jun 20, 2024
1 parent a507424 commit 5b6f37f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 78 deletions.
51 changes: 0 additions & 51 deletions src/CoreComponentsUpdaters.tsx

This file was deleted.

40 changes: 15 additions & 25 deletions src/components/header/selector/ChainSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { WalletConnectV2 } from "../../../lib/connection/WalletConnectV2";
import { getChainInfo } from "../../../lib/constants/chainInfo";
import {
getChainPriority,
TESTNET_CHAIN_IDS,
UniWalletSupportedChains
} from "../../../lib/constants/chains";
import { getSupportedChainIdsFromWalletConnectSession } from "../../../lib/utils/getSupportedChainIdsFromWalletConnectSession";
Expand Down Expand Up @@ -85,30 +84,21 @@ export const ChainSelector = ({ leftAlign }: ChainSelectorProps) => {
const walletSupportsChain = useWalletSupportedChains();

const [supportedConfigs, unsupportedChains] = useMemo(() => {
const { supported, unsupported } = NETWORK_SELECTOR_CHAINS.filter(
(config) => {
return (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
TESTNET_CHAIN_IDS.includes(config.chainId as any)
);
}
)
.sort(
({ chainId: a }, { chainId: b }) =>
getChainPriority(a as ChainId) - getChainPriority(b as ChainId)
)
.reduce(
(acc, config) => {
const { chainId: chain } = config;
if (walletSupportsChain.includes(chain as ChainId)) {
acc.supported.push(config);
} else {
acc.unsupported.push(config);
}
return acc;
},
{ supported: [], unsupported: [] } as Record<string, ProtocolConfig[]>
);
const { supported, unsupported } = NETWORK_SELECTOR_CHAINS.sort(
({ chainId: a }, { chainId: b }) =>
getChainPriority(a as ChainId) - getChainPriority(b as ChainId)
).reduce(
(acc, config) => {
const { chainId: chain } = config;
if (walletSupportsChain.includes(chain as ChainId)) {
acc.supported.push(config);
} else {
acc.unsupported.push(config);
}
return acc;
},
{ supported: [], unsupported: [] } as Record<string, ProtocolConfig[]>
);
return [supported, unsupported];
}, [walletSupportsChain]);

Expand Down
2 changes: 0 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { CommitWidgetReduxProvider } from "@bosonprotocol/react-kit";
import { ConfigProvider } from "components/config/ConfigProvider";
import { CoreSDKProvider } from "components/core-sdk/CoreSDKProvider";
import { FiatLinkProvider } from "components/header/accountDrawer/fiatOnrampModal/FiatLink";
import { CoreComponentsUpdaters } from "CoreComponentsUpdaters";
import { apolloClient } from "graphql/data/apollo";
import { MulticallUpdater } from "lib/state/multicall";
import { BlockNumberProvider } from "lib/utils/hooks/useBlockNumber";
Expand Down Expand Up @@ -62,7 +61,6 @@ root.render(
<ApolloProvider client={apolloClient}>
<BlockNumberProvider>
<Updaters />
<CoreComponentsUpdaters />
<Toaster
position="top-right"
toastOptions={{
Expand Down

0 comments on commit 5b6f37f

Please sign in to comment.