This commit is contained in:
2026-01-12 14:27:01 +01:00
parent 8601d7ced1
commit 76281892a2
5 changed files with 42 additions and 16 deletions
+7 -1
View File
@@ -17,6 +17,12 @@ export function useGameFilter(
const [fetchedTitles, setFetchedTitles] = useState<string[]>([]);
const metaDataRef = useRef<{ [key: string]: GameProto }>({});
useEffect(() => {
return () => {
metaDataRef.current = {};
};
}, []);
const { gameToNegative, gameToPositiveOpinion } = useMemo(() => {
const gameToNegative = new Map<string, Set<string>>();
const gameToPositiveOpinion = new Map<string, Set<string>>();
@@ -108,7 +114,7 @@ export function useGameFilter(
const gamesMap = useMemo(() => {
return new Map(Object.entries(metaDataRef.current));
}, [fetchedTitles]);
}, []);
return { filteredGames, gameToPositive: gameToPositiveOpinion, games: gamesMap };
}