diff --git a/src/components/score/score.tsx b/src/components/score/score.tsx index 47ae761..dd3f544 100644 --- a/src/components/score/score.tsx +++ b/src/components/score/score.tsx @@ -4,7 +4,7 @@ import BeatSaverMap from "@/common/database/types/beatsaver-map"; import ScoreSaberPlayerScoreToken from "@/common/model/token/scoresaber/score-saber-player-score-token"; import { beatsaverService } from "@/common/service/impl/beatsaver"; import LeaderboardScores from "@/components/leaderboard/leaderboard-scores"; -import { useCallback, useEffect, useState } from "react"; +import { cache, useCallback, useEffect, useState } from "react"; import ScoreButtons from "./score-buttons"; import ScoreSongInfo from "./score-info"; import ScoreRankInfo from "./score-rank-info"; @@ -23,7 +23,7 @@ export default function Score({ playerScore }: Props) { const [isLeaderboardExpanded, setIsLeaderboardExpanded] = useState(false); const fetchBeatSaverData = useCallback(async () => { - const beatSaverMap = await beatsaverService.lookupMap(leaderboard.songHash); + const beatSaverMap = await cache(async () => await beatsaverService.lookupMap(leaderboard.songHash))(); setBeatSaverMap(beatSaverMap); }, [leaderboard.songHash]);