From 38e4add466516a01cad49fee5d70dfe83aa4450a Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Tue, 8 Feb 2022 00:24:49 +0200 Subject: [PATCH] Stop showing more selects once enough scores --- app/components/play/MapList.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/components/play/MapList.tsx b/app/components/play/MapList.tsx index 78407f2bf..6240ad47b 100644 --- a/app/components/play/MapList.tsx +++ b/app/components/play/MapList.tsx @@ -40,6 +40,15 @@ export function MapList({ mapList, canSubmitScore, groupIds }: MapListProps) { setWinners(newWinners); }; + const selectInvisible = (index: number) => { + if (scoreValid(winners, mapList.length) && winners.length <= index) { + return true; + } + if (index > winners.length) return true; + + return false; + }; + return (

    Map list

    @@ -55,7 +64,7 @@ export function MapList({ mapList, canSubmitScore, groupIds }: MapListProps) { {canSubmitScore && (