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,33 @@
// Metro module 8764 (f8765).
import { useEffect } from "react";
import SubscriptionPlanStore from "../../../stores/billing/SubscriptionPlanStore";
import { PaymentGateways } from "../../../_bundle/Module505";
import ContextUtils from "../../../utils/ContextUtils";
import NativePaymentHooks_android from "./hooks/NativePaymentHooks.android";
import { fetchSubscriptionPlansBySKUs } from "../../../actions/SubscriptionPlanActionCreators";
import useSubscriptionSelection from "../hooks/useSubscriptionSelection";
import { useStateFromStores } from "../../../_bundle/Module589";
let [Component, r31, r32] = ContextUtils();
export function NativePaymentContextProvider(props) {
let selectedPlanId;
const { children, skuIDs, activeSubscription } = props;
selectedPlanId = void 0;
const nativeIAPPayments = NativePaymentHooks_android.useNativeIAPPayments();
const { nativePaymentsConnected, storeFront } = nativeIAPPayments;
useEffect(() => {
if (!(storeFront == null || SubscriptionPlanStore.isFetchingForSKUs(skuIDs))) {
fetchSubscriptionPlansBySKUs(skuIDs, storeFront.country, PaymentGateways.APPLE_ADVANCED_COMMERCE);
}
}, [storeFront, skuIDs]);
const subscriptionSelection = useSubscriptionSelection();
selectedPlanId = subscriptionSelection.selectedPlanId;
return <Component.Provider value={{
isReadyToPurchase: nativePaymentsConnected,
setSelectedPlanId: subscriptionSelection.setSelectedPlanId,
selectedPlan: useStateFromStores([SubscriptionPlanStore], () => selectedPlanId != null ? SubscriptionPlanStore.get(selectedPlanId) : null, [selectedPlanId]),
storeFront,
activeSubscription
}}>{children}</Component.Provider>;
}
export { r31 as useNativeIAPPaymentContext };
export { r32 as useForwardedNativePaymentContext };