From 410a98a0de9f7eb582eda0ff886b37a789a7b9a6 Mon Sep 17 00:00:00 2001 From: Evgeny Taktarov Date: Mon, 11 Mar 2024 20:42:47 +0700 Subject: [PATCH] fix: add disconnect support --- features/ipfs/update-promt-banner/styles.tsx | 1 + features/ipfs/update-promt-banner/use-version-check.ts | 8 ++++---- providers/web3.tsx | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/features/ipfs/update-promt-banner/styles.tsx b/features/ipfs/update-promt-banner/styles.tsx index 2529f9724..d75d911b7 100644 --- a/features/ipfs/update-promt-banner/styles.tsx +++ b/features/ipfs/update-promt-banner/styles.tsx @@ -40,6 +40,7 @@ export const WarningText = styled(Text).attrs({ export const WarningSubText = styled(Text).attrs({ weight: 400, size: 'xs', + as: 'span', color: 'secondary', })` text-align: center; diff --git a/features/ipfs/update-promt-banner/use-version-check.ts b/features/ipfs/update-promt-banner/use-version-check.ts index 29213736a..1ed8db08e 100644 --- a/features/ipfs/update-promt-banner/use-version-check.ts +++ b/features/ipfs/update-promt-banner/use-version-check.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react'; import { useLidoSWR } from '@lido-sdk/react'; -import { useForceDisconnect } from 'reef-knot/web3-react'; +import { useForceDisconnect } from 'reef-knot/core-react'; import { BASE_PATH_ASSET, dynamics } from 'config'; import { useMainnetStaticRpcProvider } from 'shared/hooks/use-mainnet-static-rpc-provider'; @@ -60,7 +60,7 @@ const isVersionLess = (versionA: string, versionB: string): boolean => { export const useVersionCheck = () => { const { setIsWalletConnectionAllowed } = useClientConfig(); - const { disconnect } = useForceDisconnect(); + const { forceDisconnect } = useForceDisconnect(); const [areConditionsAccepted, setConditionsAccepted] = useState(false); const provider = useMainnetStaticRpcProvider(); @@ -140,10 +140,10 @@ export const useVersionCheck = () => { setIsWalletConnectionAllowed(false); } if (isVersionUnsafe || (dynamics.ipfsMode && isNotVerifiable)) { - disconnect(); + forceDisconnect(); } }, [ - disconnect, + forceDisconnect, isNotVerifiable, isVersionUnsafe, setIsWalletConnectionAllowed, diff --git a/providers/web3.tsx b/providers/web3.tsx index c1998f9b3..dd7a27208 100644 --- a/providers/web3.tsx +++ b/providers/web3.tsx @@ -11,6 +11,7 @@ import { useGetRpcUrlByChainId } from 'config'; import { SDKLegacyProvider } from './sdk-legacy'; const Web3Provider: FC = ({ children }) => { + const { isWalletConnectionAllowed } = useClientConfig(); const { defaultChain: defaultChainId, supportedChainIds, @@ -95,6 +96,7 @@ const Web3Provider: FC = ({ children }) => { return (