fix missing values messages
All checks were successful
Publish / deploy (push) Successful in 1m32s

This commit is contained in:
Lee 2023-11-22 15:38:04 +00:00
parent 2fc7257929
commit 58149a8061

@ -53,12 +53,23 @@ export default function Home() {
setInterval(updateRank, 1000 * 60 * 1); // update every minute
}, [mounted, updateRank]);
/**
* {!playerId && <p>Invalid player ID</p>}
{!rank && <p>Invalid rank</p>}
{!ppDiff && <p>Calculating...</p>}
*/
if (!playerId || !rank || !ppDiff) {
if (!playerId) {
return (
<main className="text-xl text-white">
<p>Invalid or missing player ID</p>
</main>
);
}
if (!rank) {
return (
<main className="text-xl text-white">
<p>Invalid or missing rank</p>
</main>
);
}
if (!ppDiff) {
return (
<main className="text-xl text-white">
<p>Calculating...</p>