From 08883898aa83d4f8583039106f8c73e941a8ddbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20M=C3=B3rawski?= Date: Thu, 11 Apr 2024 14:43:21 +0200 Subject: [PATCH] search page banner dismiss fix --- src/hooks/useDismissedReferralBanners.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hooks/useDismissedReferralBanners.ts b/src/hooks/useDismissedReferralBanners.ts index 7f3042bf422a..94ccd0a0b567 100644 --- a/src/hooks/useDismissedReferralBanners.ts +++ b/src/hooks/useDismissedReferralBanners.ts @@ -1,6 +1,7 @@ -import {useAccount} from '@components/OnyxProvider'; +import {useOnyx} from 'react-native-onyx'; import * as User from '@userActions/User'; import type CONST from '@src/CONST'; +import ONYXKEYS from '@src/ONYXKEYS'; type UseDismissedReferralBannersProps = { referralContentType: @@ -11,7 +12,7 @@ type UseDismissedReferralBannersProps = { }; function useDismissedReferralBanners({referralContentType}: UseDismissedReferralBannersProps): {isDismissed: boolean; setAsDismissed: () => void} { - const {dismissedReferralBanners} = useAccount(); + const [dismissedReferralBanners] = useOnyx(ONYXKEYS.NVP_DISMISSED_REFERRAL_BANNERS); const isDismissed = dismissedReferralBanners?.[referralContentType] ?? false; const setAsDismissed = () => {