Module 300233

991 characters · in 4f3f89562999b601.js, 774e9e5e19db1549.js
Dependencies
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){n.d(t,{H:()=>d,X:()=>c});var r=n(477900),l=n(582128),i=n(702841),u=n(617710),s=n(579908),o=n(636194);let a=l.createContext(void 0);function c(e){let t=l.useContext(a);if(null==t)throw Error(`${e??"useGroupListingsFetchContext"} must be used within a GroupListingsFetchContextProvider`);let{listingsLoaded:n,fetchGroupListingsForGuild:r}=t;return l.useEffect(()=>{r()},[r]),n}function d(e){let{guildId:t,children:n,refetchOnMount:c,includeSoftDeleted:d,countryCode:E,dontFetchWhileTrue:A}=e,_=(0,i.bG)([u.A],()=>u.A.isConnected()),N=(0,i.bG)([o.A],()=>null!=t?o.A.getSubscriptionGroupListingsForGuildFetchState(t):o.e.FETCHED),[h,I]=l.useState(!0===c),f=l.useCallback(()=>{if(null==t||!_||!0===A)return;let e=o.A.getSubscriptionGroupListingsForGuildFetchState(t);(h||e===o.e.NOT_FETCHED)&&(I(!1),s.WA(t,{includeSoftDeleted:d,countryCode:E}))},[_,t,d,E,A,h]),C=N===o.e.FETCHED&&!h;return(0,r.jsx)(a.Provider,{value:{listingsLoaded:C,fetchGroupListingsForGuild:f},children:n})}}