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