From 124d5be020bd2c0ba6dbfb04fb2ac6435e6f40d7 Mon Sep 17 00:00:00 2001 From: schmanu Date: Fri, 3 May 2024 10:45:21 +0200 Subject: [PATCH 1/2] fix: set iframe ref after consenting --- src/features/swap/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/swap/index.tsx b/src/features/swap/index.tsx index f80ca60ab2..5223128b26 100644 --- a/src/features/swap/index.tsx +++ b/src/features/swap/index.tsx @@ -194,7 +194,7 @@ const SwapWidget = ({ sell }: Params) => { if (iframeElement) { iframeRef.current = iframeElement as HTMLIFrameElement } - }, [params]) + }, [params, isConsentAccepted]) useCustomAppCommunicator(iframeRef, appData, chain) From 6bf9f76e69d30ec8d22f7f60a94a9c15673a5b24 Mon Sep 17 00:00:00 2001 From: schmanu Date: Fri, 3 May 2024 13:03:13 +0200 Subject: [PATCH 2/2] fix: query iframe after loading the Safe --- src/features/swap/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/swap/index.tsx b/src/features/swap/index.tsx index 5223128b26..4189747fae 100644 --- a/src/features/swap/index.tsx +++ b/src/features/swap/index.tsx @@ -57,7 +57,7 @@ const SwapWidget = ({ sell }: Params) => { const swapParams = useAppSelector(selectSwapParams) const { tradeType } = swapParams - const { safeAddress } = useSafeInfo() + const { safeAddress, safeLoading } = useSafeInfo() const wallet = useWallet() const { isConsentAccepted, onAccept } = useSwapConsent() @@ -194,7 +194,7 @@ const SwapWidget = ({ sell }: Params) => { if (iframeElement) { iframeRef.current = iframeElement as HTMLIFrameElement } - }, [params, isConsentAccepted]) + }, [params, isConsentAccepted, safeLoading]) useCustomAppCommunicator(iframeRef, appData, chain)