Skip to content

Commit 5b6f37f

Browse files
fix: blank page because the app was crashing, due to having 2 ListUpd… (#1096)
1 parent a507424 commit 5b6f37f

File tree

3 files changed

+15
-78
lines changed

3 files changed

+15
-78
lines changed

src/CoreComponentsUpdaters.tsx

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/components/header/selector/ChainSelector.tsx

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { WalletConnectV2 } from "../../../lib/connection/WalletConnectV2";
1717
import { getChainInfo } from "../../../lib/constants/chainInfo";
1818
import {
1919
getChainPriority,
20-
TESTNET_CHAIN_IDS,
2120
UniWalletSupportedChains
2221
} from "../../../lib/constants/chains";
2322
import { getSupportedChainIdsFromWalletConnectSession } from "../../../lib/utils/getSupportedChainIdsFromWalletConnectSession";
@@ -85,30 +84,21 @@ export const ChainSelector = ({ leftAlign }: ChainSelectorProps) => {
8584
const walletSupportsChain = useWalletSupportedChains();
8685

8786
const [supportedConfigs, unsupportedChains] = useMemo(() => {
88-
const { supported, unsupported } = NETWORK_SELECTOR_CHAINS.filter(
89-
(config) => {
90-
return (
91-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
92-
TESTNET_CHAIN_IDS.includes(config.chainId as any)
93-
);
94-
}
95-
)
96-
.sort(
97-
({ chainId: a }, { chainId: b }) =>
98-
getChainPriority(a as ChainId) - getChainPriority(b as ChainId)
99-
)
100-
.reduce(
101-
(acc, config) => {
102-
const { chainId: chain } = config;
103-
if (walletSupportsChain.includes(chain as ChainId)) {
104-
acc.supported.push(config);
105-
} else {
106-
acc.unsupported.push(config);
107-
}
108-
return acc;
109-
},
110-
{ supported: [], unsupported: [] } as Record<string, ProtocolConfig[]>
111-
);
87+
const { supported, unsupported } = NETWORK_SELECTOR_CHAINS.sort(
88+
({ chainId: a }, { chainId: b }) =>
89+
getChainPriority(a as ChainId) - getChainPriority(b as ChainId)
90+
).reduce(
91+
(acc, config) => {
92+
const { chainId: chain } = config;
93+
if (walletSupportsChain.includes(chain as ChainId)) {
94+
acc.supported.push(config);
95+
} else {
96+
acc.unsupported.push(config);
97+
}
98+
return acc;
99+
},
100+
{ supported: [], unsupported: [] } as Record<string, ProtocolConfig[]>
101+
);
112102
return [supported, unsupported];
113103
}, [walletSupportsChain]);
114104

src/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { CommitWidgetReduxProvider } from "@bosonprotocol/react-kit";
33
import { ConfigProvider } from "components/config/ConfigProvider";
44
import { CoreSDKProvider } from "components/core-sdk/CoreSDKProvider";
55
import { FiatLinkProvider } from "components/header/accountDrawer/fiatOnrampModal/FiatLink";
6-
import { CoreComponentsUpdaters } from "CoreComponentsUpdaters";
76
import { apolloClient } from "graphql/data/apollo";
87
import { MulticallUpdater } from "lib/state/multicall";
98
import { BlockNumberProvider } from "lib/utils/hooks/useBlockNumber";
@@ -62,7 +61,6 @@ root.render(
6261
<ApolloProvider client={apolloClient}>
6362
<BlockNumberProvider>
6463
<Updaters />
65-
<CoreComponentsUpdaters />
6664
<Toaster
6765
position="top-right"
6866
toastOptions={{

0 commit comments

Comments
 (0)