From d4e9dad4434c1694157dcf170ac5fd6affc447d7 Mon Sep 17 00:00:00 2001 From: Casey Dyer Date: Wed, 4 Dec 2024 15:29:27 -0800 Subject: [PATCH] fix: add clarifying comment --- src/composables/useBadgeData.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/composables/useBadgeData.js b/src/composables/useBadgeData.js index a100f6cfbc..340a914b81 100644 --- a/src/composables/useBadgeData.js +++ b/src/composables/useBadgeData.js @@ -346,7 +346,9 @@ export default function useBadgeData() { } } else if (badge?.achievementData?.tiers?.length) { const tiers = JSON.parse(JSON.stringify(badge.achievementData.tiers)); + // Sort by completed date descending tiers.sort((a, b) => { + // Handle when tiers were achieved at the same time if (a.completedDate === b.completedDate) { return b.level - a.level; }