From 472df260feaab2baa8df4d5f6219c3ebe6e9b894 Mon Sep 17 00:00:00 2001 From: Chewbacca Date: Fri, 4 Nov 2022 07:36:48 -0400 Subject: [PATCH] Ensure Policy Modal opens upon login --- app/soapbox/features/ui/index.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/soapbox/features/ui/index.tsx b/app/soapbox/features/ui/index.tsx index ed3980ebc..3a8ae388a 100644 --- a/app/soapbox/features/ui/index.tsx +++ b/app/soapbox/features/ui/index.tsx @@ -504,10 +504,12 @@ const UI: React.FC = ({ children }) => { }, [vapidKey]); useEffect(() => { - if (pendingPolicy && supportedPolicyIds.includes(pendingPolicy.pending_policy_id)) { - dispatch(openModal('POLICY')); + if (account && pendingPolicy && supportedPolicyIds.includes(pendingPolicy.pending_policy_id)) { + setTimeout(() => { + dispatch(openModal('POLICY')); + }, 500); } - }, [pendingPolicy]); + }, [pendingPolicy, !!account]); const handleHotkeyNew = (e?: KeyboardEvent) => { e?.preventDefault();