update wording and fix day
All checks were successful
Publish / deploy (push) Successful in 44s

This commit is contained in:
Lee 2023-11-21 14:31:40 +00:00
parent 80eb7a17fe
commit dec55d3613

View File

@ -25,6 +25,7 @@ export default function Home() {
const updateRank = useCallback(async () => { const updateRank = useCallback(async () => {
if (!playerId || !rank || !page) return; if (!playerId || !rank || !page) return;
console.log("Updating rank...");
const playerData = await fetch( const playerData = await fetch(
SS_GET_PLAYER_DATA_FULL.replace("{}", playerId) SS_GET_PLAYER_DATA_FULL.replace("{}", playerId)
).then((res) => res.json()); ).then((res) => res.json());
@ -34,7 +35,6 @@ export default function Home() {
) )
.then((res) => res.json()) .then((res) => res.json())
.then((res) => res.players.find((player: any) => player.rank === rank)); .then((res) => res.players.find((player: any) => player.rank === rank));
console.log(playerAtRank);
if (!playerAtRank) { if (!playerAtRank) {
console.log("Player not found"); console.log("Player not found");
@ -61,9 +61,11 @@ export default function Home() {
{ppDiff && ( {ppDiff && (
<div className="flex gap-1 flex-col p-2"> <div className="flex gap-1 flex-col p-2">
<p> <p>
{formatNumber(ppDiff, 2)}pp to reach #{formatNumber(rank)} {formatNumber(ppDiff, 2)}pp until rank {formatNumber(rank)}
</p> </p>
{startedAt && <p>Day {getDaysSince(new Date(Number(startedAt)))}</p>} {startedAt && (
<p>Day {getDaysSince(new Date(Number(startedAt))) + 1}</p>
)}
</div> </div>
)} )}
</main> </main>