Skip to content

Commit

Permalink
search page banner dismiss fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemorawski committed Apr 11, 2024
1 parent f26e5bd commit 0888389
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hooks/useDismissedReferralBanners.ts
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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 = () => {
Expand Down

0 comments on commit 0888389

Please sign in to comment.