Build 545032stable
Module 300233
990 characters · in e16f15480ab0fbaf.jsDependencies
Source Raw
function(e,t,n){n.d(t,{H:()=>u,X:()=>c});var i=n(627968),l=n(64700),s=n(702841),r=n(587626),a=n(579908),o=n(636194);let d=l.createContext(void 0);function c(e){let t=l.useContext(d);if(null==t)throw Error(`${e??"useGroupListingsFetchContext"} must be used within a GroupListingsFetchContextProvider`);let{listingsLoaded:n,fetchGroupListingsForGuild:i}=t;return l.useEffect(()=>{i()},[i]),n}function u(e){let{guildId:t,children:n,refetchOnMount:c,includeSoftDeleted:u,countryCode:m,dontFetchWhileTrue:h}=e,g=(0,s.bG)([r.A],()=>r.A.isConnected()),p=(0,s.bG)([o.A],()=>null!=t?o.A.getSubscriptionGroupListingsForGuildFetchState(t):o.e.FETCHED),[A,x]=l.useState(!0===c),f=l.useCallback(()=>{if(null==t||!g||!0===h)return;let e=o.A.getSubscriptionGroupListingsForGuildFetchState(t);(A||e===o.e.NOT_FETCHED)&&(x(!1),a.WA(t,{includeSoftDeleted:u,countryCode:m}))},[g,t,u,m,h,A]),E=p===o.e.FETCHED&&!A;return(0,i.jsx)(d.Provider,{value:{listingsLoaded:E,fetchGroupListingsForGuild:f},children:n})}}