This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,28 @@
// Metro module 9402 (f9403).
import { useRef, useMemo } from "react";
import UserStore from "../../../../../stores/UserStore";
import { useStateFromStores } from "../../../../../_bundle/Module589";
import PremiumUtils from "../../../../../utils/PremiumUtils";
import { debounce } from "../../../../../_bundle/Module12";
export default function useEmojiPickerViewableItemsChanged(a0) {
let c17193_0 = a0;
const ref = useRef(0);
const stateFromStores = useStateFromStores([UserStore], () => {
const currentUser = UserStore.getCurrentUser();
const canUseEmojisEverywhere = PremiumUtils.canUseEmojisEverywhere(currentUser);
return canUseEmojisEverywhere ? !PremiumUtils.canUseAnimatedEmojis(currentUser) : !canUseEmojisEverywhere;
});
return useMemo(() => {
let c26433_0 = debounce(() => {
c17193_0(ref.current > 7);
}, 200);
return {
onViewableItemsChanged: stateFromStores ? (a0) => {
for (const item of a0.changed) {
ref.current = Math.max(0, ref.current + (item.item?.isSectionNitroLocked === true ? item.isViewable ? 1 : -1 : 0));
}
c26433_0();
} : void 0
};
}, [a0, stateFromStores]);
};
@@ -0,0 +1,58 @@
// Metro module 6210 (f6211).
import { useState, useRef, useCallback } from "react";
import SubscriptionStore from "../../../../../stores/billing/SubscriptionStore";
import UserOfferStore from "../../../../../stores/billing/UserOfferStore";
import { PremiumTypes } from "../../../PremiumConstants";
import { AnalyticsObjectTypes } from "../../../../../Constants";
import useAnalyticsLocations from "../../../../app_analytics/useAnalyticsLocations";
import openPremiumPlanSelectionActionSheet from "../../../native/openPremiumPlanSelectionActionSheet";
import { fetchSubscriptions } from "../../../../billing/actions/BillingActionCreators";
import { fetchUserOffer } from "../../../UserOfferActionCreators";
import { presentFailedToast } from "../../../../toast/native/ToastUtils";
import { intl, t } from "../../../../../intl/index.native";
import { getBestActiveInput } from "../../../../../utils/native/ChatInputUtils";
export default function usePremiumFeatureUpsellGetNitro(a0, a1, a2, a3) {
const page = a2;
const [loading, setState] = useState(false);
const analyticsLocations = useAnalyticsLocations().analyticsLocations;
const ref = useRef(0);
const callback = useCallback(() => {
const premiumTypeSubscription = SubscriptionStore.getPremiumTypeSubscription(false);
const hasFetchedSubscriptions = SubscriptionStore.hasFetchedSubscriptions();
const r1 = premiumTypeSubscription == null || Object.keys(premiumTypeSubscription).length === 0;
const r21 = UserOfferStore.hasFetchedOffer() && !UserOfferStore.hasAnyUnexpiredOffer();
L23: {
const isFetchingOffer = UserOfferStore.isFetchingOffer();
if (hasFetchedSubscriptions && (r1 && r21)) {
openPremiumPlanSelectionActionSheet({
analyticsLocation: {
page,
objectType: AnalyticsObjectTypes.BUY
},
analyticsLocations,
premiumType: a0 ? PremiumTypes.TIER_0 : PremiumTypes.TIER_2
}, a3);
} else {
if (!(hasFetchedSubscriptions && isFetchingOffer) && ref.current < 5) {
setState(true);
Promise.all([hasFetchedSubscriptions ? Promise.resolve() : fetchSubscriptions(), isFetchingOffer ? Promise.resolve() : fetchUserOffer("usePremiumFeatureUpsellGetNitro")]).then(() => {
ref.current = ref.current + 1;
callback();
}).catch(() => {
presentFailedToast(intl.string(t.R0RpRX));
}).finally(() => setState(false));
break L23;
}
a1();
const bestActiveInput = getBestActiveInput();
if (bestActiveInput != null) {
bestActiveInput.closeCustomKeyboard();
}
}
}
}, [a2, analyticsLocations, a1, a0, a3]);
return {
loading,
onPress: callback
};
};
@@ -0,0 +1,12 @@
// Metro module 9391 (f9392).
import { useCallback } from "react";
import { useSharedValue } from "../../../../reanimated/ReanimatedRexport";
export default function useShowNitroUpsellCallback() {
const sharedValue = useSharedValue(false);
return {
shouldShowUpsell: sharedValue,
onShowNitroUpsell: useCallback((a0) => {
sharedValue.set(a0);
}, [sharedValue])
};
};