From 913699e4b6c6e358e4a818d8ff804a76f6e8b9d3 Mon Sep 17 00:00:00 2001 From: Zamitto Date: Sat, 27 Apr 2024 20:42:28 -0300 Subject: [PATCH] replace Set with Map --- src/main/services/steam-250.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/services/steam-250.ts b/src/main/services/steam-250.ts index dc84cb21..cec70774 100644 --- a/src/main/services/steam-250.ts +++ b/src/main/services/steam-250.ts @@ -35,5 +35,11 @@ const steam250Paths = [ export const getSteam250List = async () => { const gamesPromises = steam250Paths.map((path) => requestSteam250(path)); const gamesList = (await Promise.all(gamesPromises)).flat(); - return [...new Set(gamesList)]; + + const gamesMap = gamesList.reduce((map, item) => { + map.set(item.objectID, item); + return map; + }, new Map()); + + return [...gamesMap.values()]; };