diff --git a/src/utils/compareReleasesFn.ts b/src/utils/compareReleasesFn.ts index fa2f2b02ef..d0c2ee8dff 100644 --- a/src/utils/compareReleasesFn.ts +++ b/src/utils/compareReleasesFn.ts @@ -1,13 +1,18 @@ import { ReleaseData } from '../types'; export const compareReleasesFn = (a: ReleaseData, b: ReleaseData) => { - if (new Date(a.published) > new Date(b.published)) { - return -1; + const aPublished = new Date(a.published); + const bPublished = new Date(b.published); + const sameDate = aPublished.toDateString() === bPublished.toDateString(); + const sameCommit = a.commit.label === b.commit.label; + + if (sameDate && !sameCommit) { + return aPublished > bPublished ? -1 : 1; } - if (new Date(a.published) < new Date(b.published)) { - return 1; + if (sameDate) { + return a.release.label.length - b.release.label.length; } - return 0; + return aPublished > bPublished ? -1 : 1; }; diff --git a/src/utils/getReleaseArch.ts b/src/utils/getReleaseArch.ts index a2633bed0a..6e947cd7b9 100644 --- a/src/utils/getReleaseArch.ts +++ b/src/utils/getReleaseArch.ts @@ -20,7 +20,7 @@ export const getReleaseArch = (filename: string) => { return 'MIPS32(le)'; case 'mips64': return 'MIPS64'; - case 'MIPS64(le)': + case 'mips64le': return 'MIPS64(le)'; default: return 'all';