fix: duplicate changelogs not grouping (#5146)

* fix: changelogs not grouping

* fix changelog check
This commit is contained in:
Truman Gao
2026-01-17 16:42:59 -07:00
committed by GitHub
parent 2c096a85d6
commit aec268c6e9

View File

@@ -144,11 +144,18 @@ watch(
const ids = paginated.map((v) => v.id)
const versions = await labrinth.versions_v3.getVersions(toRaw(ids))
versions.sort((a, b) => ids.indexOf(a.id) - ids.indexOf(b.id))
paginatedVersions.value = paginated.map((version) => {
paginatedVersions.value = paginated.map((version, index) => {
const fullVersion = versions.find((v) => v.id === version.id)
if (fullVersion) return { ...version, changelog: fullVersion.changelog }
if (fullVersion)
return {
...version,
duplicate:
!!fullVersion.changelog &&
versions.slice(index + 1).some((v) => v.changelog === fullVersion.changelog),
changelog: fullVersion.changelog,
}
else return version
})
},