@fluid-app/portal-sdk 0.1.385 → 0.1.386

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2601,6 +2601,7 @@ function mapDetailSubscription(bff) {
2601
2601
  attempts: 0,
2602
2602
  last_failed_at: bff.last_failed_at ?? null,
2603
2603
  next_retry_at: bff.next_retry_at ?? null,
2604
+ decline_count: bff.decline_count ?? null,
2604
2605
  skipped_count: 0,
2605
2606
  max_skips: null,
2606
2607
  cancelled_at: null,
@@ -5620,11 +5621,11 @@ const ICONS_BY_COLUMN = [
5620
5621
  offset: false
5621
5622
  }
5622
5623
  ];
5623
- function PastDueBanner({ productTitle, nextRetryAt, lastFailedAt, onUpdatePaymentClick, onDismiss, className }) {
5624
+ function PastDueBanner({ productTitle, nextRetryAt, declineCount, onUpdatePaymentClick, onDismiss, className }) {
5624
5625
  const { t } = useSubscriptionsTranslation();
5625
5626
  const [internalDismissed, setInternalDismissed] = (0, react.useState)(false);
5626
5627
  const retryScheduled = nextRetryAt != null;
5627
- const previousAttemptFailed = retryScheduled && lastFailedAt != null;
5628
+ const previousAttemptFailed = retryScheduled && (declineCount ?? 0) >= 2;
5628
5629
  if (!onDismiss && internalDismissed) return null;
5629
5630
  const heading = retryScheduled ? productTitle ? t("past_due_banner_heading_retry_scheduled_for_product", { product: productTitle }) : t("past_due_banner_heading_retry_scheduled") : productTitle ? t("past_due_banner_heading_for_product", { product: productTitle }) : t("past_due_banner_heading");
5630
5631
  const whenLabel = (() => {
@@ -6644,7 +6645,7 @@ function SubscriptionDetail({ token, onNotFound, onError, onSuccess, onMutationE
6644
6645
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PastDueBanner, {
6645
6646
  productTitle: subscription.variant?.product?.title ?? null,
6646
6647
  nextRetryAt: subscription.next_retry_at ?? null,
6647
- lastFailedAt: subscription.last_failed_at ?? null,
6648
+ declineCount: subscription.decline_count ?? null,
6648
6649
  onUpdatePaymentClick: onUpdatePaymentClick ?? (() => {
6649
6650
  const el = document.getElementById("subscription-payment-method-section");
6650
6651
  if (el) el.scrollIntoView({
@@ -7732,4 +7733,4 @@ Object.defineProperty(exports, "subscriptionsScreenPropertySchema", {
7732
7733
  }
7733
7734
  });
7734
7735
 
7735
- //# sourceMappingURL=SubscriptionsScreen-QtXnqurA.cjs.map
7736
+ //# sourceMappingURL=SubscriptionsScreen-9WaEhPup.cjs.map