fix(ssr): still show the youtube button even if the beatsaver map doesn't exist anymore
All checks were successful
deploy / deploy (push) Successful in 1m14s

This commit is contained in:
Lee 2023-11-24 20:50:51 +00:00
parent 407bcc866b
commit 4c0775b000

@ -30,6 +30,9 @@ export default function MapButtons({ leaderboard }: MapButtonsProps) {
return;
}
const json = await beatSaberMap.json();
if (json.maps[hash] !== null || json.maps[hash] !== undefined) {
return;
}
setMapId(json.maps[hash].id);
}, [hash]);
@ -40,7 +43,6 @@ export default function MapButtons({ leaderboard }: MapButtonsProps) {
return (
<div className="hidden flex-col items-center justify-between gap-1 p-1 md:flex md:items-start md:justify-end">
{mapId && (
<>
<div className="flex gap-1">
<Tooltip>
<TooltipTrigger>
@ -63,6 +65,7 @@ export default function MapButtons({ leaderboard }: MapButtonsProps) {
<CopyBsrButton mapId={mapId} />
</div>
)}
<div className="flex gap-1">
<Tooltip>
<TooltipTrigger>
@ -87,8 +90,6 @@ export default function MapButtons({ leaderboard }: MapButtonsProps) {
</TooltipContent>
</Tooltip>
</div>
</>
)}
</div>
);
}