From 94f8371ea2b56b3eeedab31d5d8d1422dd20d4c7 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Tue, 27 Dec 2022 22:31:19 +0000 Subject: [PATCH] fix: don't show rivals if you haven't played the game --- client/src/components/tables/dropdowns/ScoreDropdown.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/components/tables/dropdowns/ScoreDropdown.tsx b/client/src/components/tables/dropdowns/ScoreDropdown.tsx index 92d0d527d..eef64f923 100644 --- a/client/src/components/tables/dropdowns/ScoreDropdown.tsx +++ b/client/src/components/tables/dropdowns/ScoreDropdown.tsx @@ -17,6 +17,7 @@ import { } from "tachi-common"; import { GoalsOnChartReturn, UGPTChartPBComposition } from "types/api-returns"; import { GamePT, SetState } from "types/react"; +import useLUGPTSettings from "components/util/useLUGPTSettings"; import { GPTDropdownSettings } from "./GPTDropdownSettings"; import DocComponentCreator, { DocumentComponentType } from "./components/DocumentComponent"; import DropdownStructure from "./components/DropdownStructure"; @@ -62,7 +63,7 @@ export default function ScoreDropdown({ const [view, setView] = useState(defaultView); const { user: currentUser } = useContext(UserContext); - const { settings } = useContext(UserSettingsContext); + const { settings } = useLUGPTSettings(); const { data, error } = useApiQuery>( `/users/${user.id}/games/${game}/${playtype}/pbs/${chart.chartID}?getComposition=true` @@ -166,7 +167,7 @@ export default function ScoreDropdown({ Goals & Quests{targetData && ` (${targetData.goals.length})`} )} - {currentUser && ( + {currentUser?.id === user.id && settings?.rivals && ( Rivals