From 4c0775b0003bdb3529a0da61021be8e1b91d5ad3 Mon Sep 17 00:00:00 2001 From: Liam Date: Fri, 24 Nov 2023 20:50:51 +0000 Subject: [PATCH] fix(ssr): still show the youtube button even if the beatsaver map doesn't exist anymore --- src/components/player/score/MapButtons.tsx | 93 +++++++++++----------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/src/components/player/score/MapButtons.tsx b/src/components/player/score/MapButtons.tsx index ec5c6c0..ee5dded 100644 --- a/src/components/player/score/MapButtons.tsx +++ b/src/components/player/score/MapButtons.tsx @@ -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,55 +43,53 @@ export default function MapButtons({ leaderboard }: MapButtonsProps) { return (
{mapId && ( - <> -
- - - + + + + - - - -

Click to open the map page

-
-
+ + + +
+ +

Click to open the map page

+
+
- -
-
- - - - - - - -

Click to view the song on YouTube

-
-
-
- + +
)} +
+ + + + + + + +

Click to view the song on YouTube

+
+
+
); }