fix no data error
This commit is contained in:
parent
c84f617e5c
commit
97ac27e78a
@ -35,7 +35,11 @@ export function FilteredGamesList({
|
|||||||
const positiveCount = gameToPositive.get(game)?.size || 0;
|
const positiveCount = gameToPositive.get(game)?.size || 0;
|
||||||
const neutralCount = selectedPeopleCount - positiveCount;
|
const neutralCount = selectedPeopleCount - positiveCount;
|
||||||
const gameData = games.get(game);
|
const gameData = games.get(game);
|
||||||
const price = gameData?.price || 0;
|
if (!gameData) {
|
||||||
|
console.error("no data", game);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const price = gameData.price;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
@ -81,7 +85,10 @@ export function FilteredGamesList({
|
|||||||
padding: "0.2rem 0.6rem",
|
padding: "0.2rem 0.6rem",
|
||||||
borderRadius: "4px",
|
borderRadius: "4px",
|
||||||
display: "inline-block",
|
display: "inline-block",
|
||||||
backgroundColor: price === 0 ? "rgba(76, 175, 80, 0.2)" : "rgba(255, 152, 0, 0.2)",
|
backgroundColor:
|
||||||
|
price === 0
|
||||||
|
? "rgba(76, 175, 80, 0.2)"
|
||||||
|
: "rgba(255, 152, 0, 0.2)",
|
||||||
color: price === 0 ? "#4caf50" : "#ff9800",
|
color: price === 0 ? "#4caf50" : "#ff9800",
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -112,9 +112,7 @@ export function useGameFilter(
|
|||||||
selectedPeople,
|
selectedPeople,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const gamesMap = useMemo(() => {
|
const gamesMap = new Map(Object.entries(metaDataRef.current));
|
||||||
return new Map(Object.entries(metaDataRef.current));
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return { filteredGames, gameToPositive: gameToPositiveOpinion, games: gamesMap };
|
return { filteredGames, gameToPositive: gameToPositiveOpinion, games: gamesMap };
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user