fix(payment): consume first recharge offer after payment

This commit is contained in:
2026-07-03 10:54:46 +08:00
parent bb6ebbae7e
commit 489554cd78
13 changed files with 137 additions and 27 deletions
@@ -38,6 +38,8 @@ interface DismissalState {
dismissed: boolean;
}
const FIRST_RECHARGE_DEFAULT_DISCOUNT_PERCENT = 50;
export function shouldShowFirstRechargeOfferBanner(
input: FirstRechargeOfferBannerEligibility,
): boolean {
@@ -66,7 +68,7 @@ export function useFirstRechargeOfferBanner({
loaded: false,
dismissed: false,
}));
const discountPercent = payment.firstRechargeOffer?.discountPercent ?? 50;
const discountPercent = FIRST_RECHARGE_DEFAULT_DISCOUNT_PERCENT;
useEffect(() => {
if (!isAuthenticatedUser) return;