diff --git a/src/lib/components/ui/PremierRatingBadge.svelte b/src/lib/components/ui/PremierRatingBadge.svelte index 31cb50e..fbb1b98 100644 --- a/src/lib/components/ui/PremierRatingBadge.svelte +++ b/src/lib/components/ui/PremierRatingBadge.svelte @@ -24,10 +24,26 @@ }: Props = $props(); // Determine if this is a legacy CS:GO match (has old rank but no new rating) + // CS:GO skill groups are 0-18, CS2 ratings are typically > 1000 const isLegacyRank = $derived( - (!rating || rating === 0) && oldRating !== undefined && oldRating !== null && oldRating > 0 + oldRating !== undefined && + oldRating !== null && + oldRating >= 0 && + oldRating <= 18 && + (!rating || rating === 0 || rating > 30000) ); + // Debug logging (temporary) + $effect(() => { + if (oldRating !== undefined || rating !== undefined) { + console.log('[PremierRatingBadge]', { + oldRating, + rating, + isLegacyRank + }); + } + }); + const tierInfo = $derived(formatPremierRating(rating)); const changeInfo = $derived(showChange ? getPremierRatingChange(oldRating, rating) : null);