28 lines
1.5 KiB
TypeScript
28 lines
1.5 KiB
TypeScript
// Metro module 15219 (f15220).
|
|
import { isGuildOwner } from "../../records/GuildRecord";
|
|
import GuildStore from "../../stores/GuildStore";
|
|
import UserStore from "../../stores/UserStore";
|
|
import { GuildFeatures } from "../../Constants";
|
|
import { useStateFromStores } from "../../_bundle/Module589";
|
|
import { useIsUserInCreatorMonetizationEligibleCountry } from "../creator_monetization_eligibility/CreatorMonetizationEligibilityExperimentUtils";
|
|
export default function useIsGuildEligibleForRoleSubscriptionsUpsell(c21777_0) {
|
|
const stateFromStores = useStateFromStores([GuildStore], () => GuildStore.getGuild(c21777_0));
|
|
const stateFromStores2 = useStateFromStores([UserStore], () => UserStore.getCurrentUser());
|
|
let r22 = stateFromStores != null && isGuildOwner(stateFromStores, stateFromStores2);
|
|
const isUserInCreatorMonetizationEligibleCountry = useIsUserInCreatorMonetizationEligibleCountry();
|
|
if (r22) {
|
|
let r28 = stateFromStores == null ? void 0 : stateFromStores.features.has(GuildFeatures.COMMUNITY);
|
|
if (r28 == null) {
|
|
r28 = false;
|
|
}
|
|
r22 = r28;
|
|
}
|
|
if (r22) {
|
|
r22 = isUserInCreatorMonetizationEligibleCountry;
|
|
}
|
|
if (r22) {
|
|
r22 = !((stateFromStores == null ? void 0 : stateFromStores.features.has(GuildFeatures.CREATOR_MONETIZABLE)) || (stateFromStores == null ? void 0 : stateFromStores.features.has(GuildFeatures.CREATOR_MONETIZABLE_PROVISIONAL)) || (stateFromStores == null ? void 0 : stateFromStores.features.has(GuildFeatures.CREATOR_MONETIZABLE_DISABLED)));
|
|
}
|
|
return r22;
|
|
};
|