From 363fbd1d9b04d258675c81cec2507d2d1c7ea9b9 Mon Sep 17 00:00:00 2001 From: Princi Vershwal Date: Tue, 23 Jan 2024 14:59:55 +0530 Subject: [PATCH] Added delay to avoid preview flashing (#19548) --- .../src/components/settings/membership/portal/PortalFrame.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/admin-x-settings/src/components/settings/membership/portal/PortalFrame.tsx b/apps/admin-x-settings/src/components/settings/membership/portal/PortalFrame.tsx index 64a180a95d..9fee8d4efe 100644 --- a/apps/admin-x-settings/src/components/settings/membership/portal/PortalFrame.tsx +++ b/apps/admin-x-settings/src/components/settings/membership/portal/PortalFrame.tsx @@ -19,6 +19,7 @@ const PortalFrame: React.FC = ({href, onDestroyed, selectedTab const makeVisible = useCallback(() => { setTimeout(() => { if (iframeRef.current) { + setHasLoaded(true); setIsInvisible(false); } }, 100); // Delay to allow scripts to render @@ -64,7 +65,6 @@ const PortalFrame: React.FC = ({href, onDestroyed, selectedTab title="Portal Preview" width="100%" onLoad={() => { - setHasLoaded(true); makeVisible(); }} />