Page MenuHomePhabricator

D11491.id38597.diff
No OneTemporary

D11491.id38597.diff

diff --git a/landing/siwe.react.js b/landing/siwe.react.js
--- a/landing/siwe.react.js
+++ b/landing/siwe.react.js
@@ -88,27 +88,23 @@
const [wcModalOpen, setWCModalOpen] = React.useState(false);
- const prevConnectModalOpen = React.useRef(false);
+ const prevModalOpen = React.useRef(false);
const modalState = useModalState();
const closeTimeoutRef = React.useRef<?TimeoutID>();
const { connectModalOpen } = modalState;
+ const modalOpen = connectModalOpen || wcModalOpen;
React.useEffect(() => {
- if (
- !connectModalOpen &&
- !wcModalOpen &&
- prevConnectModalOpen.current &&
- !signer
- ) {
+ if (!modalOpen && prevModalOpen.current && !signer) {
closeTimeoutRef.current = setTimeout(
() => postMessageToNativeWebView({ type: 'siwe_closed' }),
- 250,
+ 500,
);
} else if (closeTimeoutRef.current) {
clearTimeout(closeTimeoutRef.current);
closeTimeoutRef.current = undefined;
}
- prevConnectModalOpen.current = connectModalOpen;
- }, [connectModalOpen, wcModalOpen, signer]);
+ prevModalOpen.current = modalOpen;
+ }, [modalOpen, signer]);
const onWalletConnectModalUpdate = React.useCallback(
(update: WalletConnectModalUpdate) => {
diff --git a/native/account/siwe-panel.react.js b/native/account/siwe-panel.react.js
--- a/native/account/siwe-panel.react.js
+++ b/native/account/siwe-panel.react.js
@@ -160,10 +160,17 @@
closeBottomSheet?.();
} else if (data.type === 'walletconnect_modal_update') {
const height = data.state === 'open' ? data.height : 0;
- setWalletConnectModalHeight(height);
+ if (!walletConnectModalHeight || height > 0) {
+ setWalletConnectModalHeight(height);
+ }
}
},
- [onSuccessfulWalletSignature, onClosing, closeBottomSheet],
+ [
+ onSuccessfulWalletSignature,
+ onClosing,
+ closeBottomSheet,
+ walletConnectModalHeight,
+ ],
);
const prevClosingRef = React.useRef<?boolean>();
React.useEffect(() => {

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 7:30 AM (21 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2582852
Default Alt Text
D11491.id38597.diff (2 KB)

Event Timeline