|
@@ -4,7 +4,7 @@ import { makeQuestionMarker, makeFlagMarker, makeLine } from "../components/scre
|
|
|
import getColorGenerator from "../components/screens/RoundSummary/getColorGenerator";
|
|
|
import { useRef } from "react";
|
|
|
|
|
|
-export default (mapRef, players, targetPoint) => {
|
|
|
+export default (mapRef, playersRaw, roundNum, targetPoint) => {
|
|
|
// set up the flag at the target point
|
|
|
useEffect(() => {
|
|
|
if (targetPoint === null) {
|
|
@@ -14,6 +14,11 @@ export default (mapRef, players, targetPoint) => {
|
|
|
return () => targetMarker.setMap(null);
|
|
|
}, [mapRef, targetPoint]);
|
|
|
|
|
|
+ // get just the relevant players to put on the map
|
|
|
+ const players = playersRaw
|
|
|
+ ?.filter(({ guesses }) => guesses[roundNum] && guesses[roundNum].score !== null)
|
|
|
+ ?.map(({ name, totalScore, guesses }) => ({ name, totalScore, guess: guesses[roundNum] }));
|
|
|
+
|
|
|
// get the current player's name
|
|
|
const playerName = usePlayerName();
|
|
|
|