1 import { useEffect } from 'react';
3 import type { OfferConfig } from '../interface';
4 import useOfferFlags from './useOfferFlags';
7 * Mark the offer as visited
9 const useVisitedOffer = (offerConfig: OfferConfig) => {
10 const { handleVisit, isVisited, loading } = useOfferFlags(offerConfig);
13 if (!loading && !isVisited && offerConfig.autoPopUp === 'one-time') {
14 // Only mark offer as visited for one-time offers to not show it again
15 // if autoPopUp === 'each-time', it will still show the offer each time because the offer is not marked as visited
21 export default useVisitedOffer;