Skip to content

Commit b7c7c8b

Browse files
fix id group hash calculation
1 parent 43b89fa commit b7c7c8b

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/calculator/id/components/IdGroupHashComponent.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ import GroupHashComponent from "../../GroupHashComponent.tsx"
66
export default function IdGroupHashComponent({mods}: { mods: IdMod[] }) {
77
const [combinedHash, setCombinedHash] = useState<string>()
88

9+
910
useEffect(() => {
10-
const input: string = mods
11-
.filter((mod) => !mod.softWhitelist)
12-
.map((mod) => mod.id)
13-
.sort()
14-
.join("|")
15-
md5(input).then((result) => setCombinedHash(result))
11+
(async () => {
12+
const hashes = await Promise.all(mods.filter((mod) => !mod.softWhitelist).map((mod) => mod.id))
13+
setCombinedHash(await md5(hashes.sort().join("|")))
14+
})()
1615
}, [mods])
1716

1817
return (

0 commit comments

Comments
 (0)