Skip to content

Commit

Permalink
fix: sdk filter old subscription phases (#523)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsbh authored Mar 7, 2024
1 parent bad13a2 commit 17c0cc0
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ export function UpcomingPlanChangeBanner({
const [isPlanLoading, setIsPlanLoading] = useState(false);
const [isPlanChangeLoading, setIsPlanChangeLoading] = useState(false);

const nextPhase = subscription?.phases?.[0];
const phases =
subscription?.phases?.filter(phase =>
dayjs(phase.effective_at).isAfter(dayjs())
) || [];

const nextPhase = phases?.[0];

const fetchPlan = useCallback(
async (planId: string) => {
Expand Down

0 comments on commit 17c0cc0

Please sign in to comment.