This commit is contained in:
parent
794de708b9
commit
43d52e335e
@ -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 ScoreSaberPlayerScoreToken from "@/common/model/token/scoresaber/score-saber-player-score-token";
|
||||||
import { beatsaverService } from "@/common/service/impl/beatsaver";
|
import { beatsaverService } from "@/common/service/impl/beatsaver";
|
||||||
import LeaderboardScores from "@/components/leaderboard/leaderboard-scores";
|
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 ScoreButtons from "./score-buttons";
|
||||||
import ScoreSongInfo from "./score-info";
|
import ScoreSongInfo from "./score-info";
|
||||||
import ScoreRankInfo from "./score-rank-info";
|
import ScoreRankInfo from "./score-rank-info";
|
||||||
@ -23,7 +23,7 @@ export default function Score({ playerScore }: Props) {
|
|||||||
const [isLeaderboardExpanded, setIsLeaderboardExpanded] = useState(false);
|
const [isLeaderboardExpanded, setIsLeaderboardExpanded] = useState(false);
|
||||||
|
|
||||||
const fetchBeatSaverData = useCallback(async () => {
|
const fetchBeatSaverData = useCallback(async () => {
|
||||||
const beatSaverMap = await beatsaverService.lookupMap(leaderboard.songHash);
|
const beatSaverMap = await cache(async () => await beatsaverService.lookupMap(leaderboard.songHash))();
|
||||||
setBeatSaverMap(beatSaverMap);
|
setBeatSaverMap(beatSaverMap);
|
||||||
}, [leaderboard.songHash]);
|
}, [leaderboard.songHash]);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user