Skip to content

Commit

Permalink
fix: sort items when the array contains more than one
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus authored Feb 27, 2021
2 parents cadd1b2 + afd7315 commit d88121c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/factories/createRoarrInitialGlobalState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import createNodeWriter from './createNodeWriter';
export default (currentState: any): RoarrGlobalState => {
const versions = (currentState.versions || []).concat();

versions.sort(cmp);
if (versions.length > 1) {
versions.sort(cmp);
}

const currentIsLatestVersion = !versions.length || cmp(pkg.version, versions[versions.length - 1]) === 1;

Expand Down

0 comments on commit d88121c

Please sign in to comment.