From 51eaa9e27485ea31971e1b80adbf56b00e77d0ac Mon Sep 17 00:00:00 2001 From: James Mealy Date: Wed, 18 Dec 2024 16:15:33 +0000 Subject: [PATCH] fix: popup flickers when survey has already been completed --- src/features/targetedOutreach/hooks/useShowOutreachPopup.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/features/targetedOutreach/hooks/useShowOutreachPopup.tsx b/src/features/targetedOutreach/hooks/useShowOutreachPopup.tsx index 39875f1007..70b39a329d 100644 --- a/src/features/targetedOutreach/hooks/useShowOutreachPopup.tsx +++ b/src/features/targetedOutreach/hooks/useShowOutreachPopup.tsx @@ -12,7 +12,8 @@ const useShowOutreachPopup = ( const cookiesPopup = useAppSelector(selectCookieBanner) const isSigner = useIsSafeOwner() - const isTargetedSafe = ACTIVE_OUTREACH.targetAll || !!submission?.outreachId + const submissionHasLoaded = submission !== undefined + const isTargetedSafe = submissionHasLoaded && (ACTIVE_OUTREACH.targetAll || !!submission?.outreachId) const hasCompletedSurvey = !!submission?.completionDate if (cookiesPopup?.open || isDismissed || !isSigner || !isTargetedSafe || hasCompletedSurvey) {