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