Fix version sorting (#600)

This commit is contained in:
Geometrically 2022-08-14 15:20:42 -07:00 committed by GitHub
parent 673f7a82d1
commit 0f5aa9f8d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,9 @@ export default (ctx, inject) => {
inject('computeVersions', (versions) => {
const versionsMap = {}
for (const version of versions.reverse()) {
for (const version of versions.sort(
(a, b) => ctx.$dayjs(a.date_published) - ctx.$dayjs(b.date_published)
)) {
if (versionsMap[version.version_number]) {
versionsMap[version.version_number].push(version)
} else {
@ -129,7 +131,9 @@ export default (ctx, inject) => {
}
}
return returnVersions.reverse()
return returnVersions.sort(
(a, b) => ctx.$dayjs(b.date_published) - ctx.$dayjs(a.date_published)
)
})
inject('getProjectTypeForDisplay', (type, categories) => {
if (type === 'mod') {