Module 125022

809 characters · in 30a277b9d32d70b1.js
Dependencies
Required by (2)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){n.d(t,{A:()=>m});var i=n(311907),l=n(73153),a=n(927813),r=n(48128);let s=a.A.Millis.DAY,o=5*a.A.Millis.MINUTE,d={},c=!1,u=null,A=null;function h(){!(c||null!=A&&Date.now()<A+o)&&(null==u||Date.now()>=u+s)&&r.A.fetch()}class _ extends i.Ay.Store{static displayName="UnclaimedGamesStore";getUnclaimedGameIdsForGuild(e){return h(),d[e]??[]}hasUnclaimedGames(e){h();let t=d[e];return null!=t&&t.length>0}getGuildIdsWithUnclaimedGames(){return h(),Object.keys(d).filter(e=>d[e].length>0)}get fetching(){return c}get lastFetchedAt(){return u}}let m=new _(l.h,{LOGOUT:function(){d={},c=!1,u=null,A=null},UNCLAIMED_GAMES_FETCH:function(){c=!0},UNCLAIMED_GAMES_FETCH_SUCCESS:function(e){let{guildIdToGameIds:t}=e;d=t,c=!1,u=Date.now(),A=null},UNCLAIMED_GAMES_FETCH_FAIL:function(){c=!1,A=Date.now()}})}