54 lines
1.9 KiB
TypeScript
54 lines
1.9 KiB
TypeScript
// Metro module 6546 (f6547).
|
|
import { UserSettingsSections } from "../../../Constants";
|
|
import * as _PremiumBundledPlansUtils from "./PremiumBundledPlansUtils";
|
|
import ModalActionCreators from "../../../actions/ModalActionCreators";
|
|
import { PREMIUM_KEY } from "../../../components_native/premium/PremiumModal";
|
|
import { trackUserSettingsPaneViewed } from "../../../utils/UserSettingsUtils";
|
|
export function launchPremiumPlanSelect({ predicate, navigation, showCurrentPlan = true, isBoostPurchaseFlow = false, analyticsLocation, analyticsLocations, planId, applicationId, guildId, onBack, onPaymentSuccess, onPaymentDismiss }) {
|
|
const wrappedPredicate = function wrappedPredicate(a0) {
|
|
const shouldAlwaysExcludeFromPlanSelect = _PremiumBundledPlansUtils.shouldAlwaysExcludeFromPlanSelect(a0);
|
|
let r12 = !shouldAlwaysExcludeFromPlanSelect;
|
|
if (!shouldAlwaysExcludeFromPlanSelect) {
|
|
let r14 = predicate == null ? void 0 : predicate(a0);
|
|
if (r14 == null) {
|
|
r14 = true;
|
|
}
|
|
r12 = r14;
|
|
}
|
|
return r12;
|
|
};
|
|
const PREMIUM_PLAN_SELECT = UserSettingsSections.PREMIUM_PLAN_SELECT;
|
|
if (navigation != null) {
|
|
navigation.push(PREMIUM_PLAN_SELECT, {
|
|
predicate: wrappedPredicate,
|
|
analyticsLocation,
|
|
analyticsLocations,
|
|
showCurrentPlan,
|
|
isBoostPurchaseFlow,
|
|
planId,
|
|
applicationId,
|
|
guildId,
|
|
onPaymentSuccess,
|
|
onPaymentDismiss
|
|
});
|
|
} else {
|
|
ModalActionCreators.pushLazy(import("../../../components_native/premium/PremiumModal"), {
|
|
initialRoute: PREMIUM_PLAN_SELECT,
|
|
analyticsLocation,
|
|
analyticsLocations,
|
|
predicate: wrappedPredicate,
|
|
showCurrentPlan,
|
|
isBoostPurchaseFlow,
|
|
planId,
|
|
applicationId,
|
|
guildId,
|
|
onBack,
|
|
onPaymentSuccess,
|
|
onPaymentDismiss
|
|
}, PREMIUM_KEY);
|
|
}
|
|
trackUserSettingsPaneViewed({
|
|
destinationPane: PREMIUM_PLAN_SELECT
|
|
});
|
|
}
|