fix: guard claimedMilestones in MilestonesPanel component
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 18s

This commit is contained in:
2026-03-28 18:39:27 +01:00
parent 1ca88df3ed
commit 450d559216

View File

@@ -13,7 +13,8 @@ export function MilestonesPanel() {
const claimable = getClaimableMilestones(state); const claimable = getClaimableMilestones(state);
const nextMilestone = getNextMilestone(state); const nextMilestone = getNextMilestone(state);
const totalClaimed = state.claimedMilestones.length; const claimed = state.claimedMilestones ?? [];
const totalClaimed = claimed.length;
return ( return (
<div className="gp"> <div className="gp">
@@ -73,7 +74,7 @@ export function MilestonesPanel() {
{/* Liste compacte des milestones passés */} {/* Liste compacte des milestones passés */}
{totalClaimed > 0 && claimable.length === 0 && ( {totalClaimed > 0 && claimable.length === 0 && (
<div className="flex flex-wrap gap-1 mt-1"> <div className="flex flex-wrap gap-1 mt-1">
{PRESTIGE_MILESTONES.filter((m) => state.claimedMilestones.includes(m.id)).map((m) => ( {PRESTIGE_MILESTONES.filter((m) => claimed.includes(m.id)).map((m) => (
<span <span
key={m.id} key={m.id}
className="gp-label text-[0.55rem]! px-1.5 py-0.5 rounded bg-purple-500/10 border border-purple-500/20" className="gp-label text-[0.55rem]! px-1.5 py-0.5 rounded bg-purple-500/10 border border-purple-500/20"