Loading
function(e,t,l){l.d(t,{g:()=>i}),l(321073);var r=l(64700),n=l(702841),s=l(228366),a=l(248352),o=l(652215);function i(){let e=r.useRef(new Map),t=(0,n.bG)([a.A],()=>a.A.getUserDiscounts());r.useEffect(()=>{let l=e.current,r=Date.now(),n=[];return t.forEach(e=>{if(null==e.expiresAt)return;let t=e.expiresAt.getTime()-r;if(t<=0)n.push(e.discountId);else{let r=setTimeout(()=>{s.h.dispatch({type:"COLLECTIBLES_USER_DISCOUNTS_EXPIRED",discountIds:[e.discountId]}),l.delete(e.discountId)},Math.min(o.mnr,t));l.set(e.discountId,r)}}),n.length>0&&s.h.dispatch({type:"COLLECTIBLES_USER_DISCOUNTS_EXPIRED",discountIds:n}),()=>{l.forEach(e=>clearTimeout(e)),l.clear()}},[t])}}