From a71f7a7d59c1825a1817e7ff1c0b43897c517c7a Mon Sep 17 00:00:00 2001 From: Amber Date: Mon, 5 Oct 2026 22:56:22 +0800 Subject: [PATCH 1/3] fix(parkour): times being n/a when they equal 0 Closes https://discord.com/channels/692521100650741781/1556677529618874449 --- apps/discord-bot/src/commands/parkour/parkour.profile.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/discord-bot/src/commands/parkour/parkour.profile.tsx b/apps/discord-bot/src/commands/parkour/parkour.profile.tsx index b5c9d185a..04fde47e7 100644 --- a/apps/discord-bot/src/commands/parkour/parkour.profile.tsx +++ b/apps/discord-bot/src/commands/parkour/parkour.profile.tsx @@ -29,7 +29,7 @@ export const ParkourProfile = ({ const times: [GameId, any][] = Object.entries(parkour) .sort((a, b) => (a[1] || Number.MAX_VALUE) - (b[1] || Number.MAX_VALUE)) - .map(([field, time]) => [field as GameId, time ? formatTime(time) : "N/A"]); + .map(([field, time]) => [field as GameId, time !== null ? formatTime(time) : "N/A"]); return ( From 1aaa9b9b19fd45e36f6983f217fe1d8a37e178c2 Mon Sep 17 00:00:00 2001 From: Robert Date: Tue, 6 Oct 2026 00:04:51 -0400 Subject: [PATCH 2/3] fix(parkour): show 0ms times instead of N/A A 0ms parkour time is falsy, so the profile showed N/A and sorted it last. Replace the truthiness checks with a hasTime guard that only treats null, undefined, and NaN as missing. Unplayed lobbies still show N/A, and 0ms now sorts first. --- .../src/commands/parkour/parkour.profile.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/apps/discord-bot/src/commands/parkour/parkour.profile.tsx b/apps/discord-bot/src/commands/parkour/parkour.profile.tsx index 04fde47e7..cb7e19b8b 100644 --- a/apps/discord-bot/src/commands/parkour/parkour.profile.tsx +++ b/apps/discord-bot/src/commands/parkour/parkour.profile.tsx @@ -16,6 +16,9 @@ interface ParkourProfileProps extends BaseProfileProps { gameIcons: Record; } +const hasTime = (t: unknown): t is number => + typeof t === "number" && !Number.isNaN(t); + export const ParkourProfile = ({ skin, player, @@ -28,9 +31,16 @@ export const ParkourProfile = ({ const { parkour } = player.stats; const times: [GameId, any][] = Object.entries(parkour) - .sort((a, b) => (a[1] || Number.MAX_VALUE) - (b[1] || Number.MAX_VALUE)) - .map(([field, time]) => [field as GameId, time !== null ? formatTime(time) : "N/A"]); - + .sort( + (a, b) => + (hasTime(a[1]) ? a[1] : Number.MAX_VALUE) - + (hasTime(b[1]) ? b[1] : Number.MAX_VALUE), + ) + .map(([field, time]) => [ + field as GameId, + hasTime(time) ? formatTime(time) : "N/A", + ]); + return (
Date: Tue, 6 Oct 2026 00:05:57 -0400 Subject: [PATCH 3/3] style(parkour): remove trailing whitespace --- apps/discord-bot/src/commands/parkour/parkour.profile.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/discord-bot/src/commands/parkour/parkour.profile.tsx b/apps/discord-bot/src/commands/parkour/parkour.profile.tsx index cb7e19b8b..bfd7bfa48 100644 --- a/apps/discord-bot/src/commands/parkour/parkour.profile.tsx +++ b/apps/discord-bot/src/commands/parkour/parkour.profile.tsx @@ -40,7 +40,7 @@ export const ParkourProfile = ({ field as GameId, hasTime(time) ? formatTime(time) : "N/A", ]); - + return (