Page MenuHomePhabricator

D6738.id22611.diff
No OneTemporary

D6738.id22611.diff

diff --git a/landing/siwe.react.js b/landing/siwe.react.js
--- a/landing/siwe.react.js
+++ b/landing/siwe.react.js
@@ -39,6 +39,7 @@
const { chains, provider } = configureWagmiChains(process.env.COMM_ALCHEMY_KEY);
const connectors = connectorsForWallets([
{
+ groupName: 'Recommended',
wallets: [
injectedWallet({ chains }),
rainbowWallet({ chains }),
@@ -94,10 +95,17 @@
const prevConnectModalOpen = React.useRef(false);
const modalState = useModalState();
+ const closeTimeoutRef = React.useRef();
const { connectModalOpen } = modalState;
React.useEffect(() => {
if (!connectModalOpen && prevConnectModalOpen.current && !signer) {
- postMessageToNativeWebView({ type: 'siwe_closed' });
+ closeTimeoutRef.current = setTimeout(
+ () => postMessageToNativeWebView({ type: 'siwe_closed' }),
+ 50,
+ );
+ } else if (closeTimeoutRef.current) {
+ clearTimeout(closeTimeoutRef.current);
+ closeTimeoutRef.current = undefined;
}
prevConnectModalOpen.current = connectModalOpen;
}, [connectModalOpen, signer]);

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 3:04 PM (21 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2677283
Default Alt Text
D6738.id22611.diff (1 KB)

Event Timeline