diff --git a/landing/siwe.react.js b/landing/siwe.react.js --- a/landing/siwe.react.js +++ b/landing/siwe.react.js @@ -4,7 +4,6 @@ useConnectModal, RainbowKitProvider, darkTheme, - useModalState, } from '@rainbow-me/rainbowkit'; import '@rainbow-me/rainbowkit/styles.css'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; @@ -86,7 +85,7 @@ siweMessageType, ]); - const { openConnectModal } = useConnectModal(); + const { openConnectModal, connectModalOpen } = useConnectModal(); const hasNonce = siweNonce !== null && siweNonce !== undefined; React.useEffect(() => { if (hasNonce && openConnectModal) { @@ -97,19 +96,10 @@ const [wcModalOpen, setWCModalOpen] = React.useState(false); const prevModalOpen = React.useRef(false); - const modalState = useModalState(); - const closeTimeoutRef = React.useRef(); - const { connectModalOpen } = modalState; const modalOpen = connectModalOpen || wcModalOpen; React.useEffect(() => { if (!modalOpen && prevModalOpen.current && !signer) { - closeTimeoutRef.current = setTimeout( - () => postMessageToNativeWebView({ type: 'siwe_closed' }), - 500, - ); - } else if (closeTimeoutRef.current) { - clearTimeout(closeTimeoutRef.current); - closeTimeoutRef.current = undefined; + postMessageToNativeWebView({ type: 'siwe_closed' }); } prevModalOpen.current = modalOpen; }, [modalOpen, signer]); diff --git a/patches/@rainbow-me+rainbowkit+2.0.4.patch b/patches/@rainbow-me+rainbowkit+2.0.4.patch --- a/patches/@rainbow-me+rainbowkit+2.0.4.patch +++ b/patches/@rainbow-me+rainbowkit+2.0.4.patch @@ -1,12 +1,11 @@ diff --git a/node_modules/@rainbow-me/rainbowkit/dist/index.js b/node_modules/@rainbow-me/rainbowkit/dist/index.js -index 3d856c7..95d5a23 100644 +index 3d856c7..7653c4f 100644 --- a/node_modules/@rainbow-me/rainbowkit/dist/index.js +++ b/node_modules/@rainbow-me/rainbowkit/dist/index.js -@@ -6518,5 +6518,7 @@ export { +@@ -6518,5 +6518,6 @@ export { useAccountModal, useAddRecentTransaction, useChainModal, -+ useModalState, + emojiAvatarForAddress, useConnectModal };