Skip to content

Commit

Permalink
fix: import the whole package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Feb 26, 2021
1 parent 66a0d26 commit cadd1b2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/factories/createRoarrInitialGlobalState.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import environmentIsNode from 'detect-node';
import cmp from 'semver-compare';
import {
version,
} from '../../package.json';
import pkg from '../../package.json';
import type {
RoarrGlobalState,
} from '../types';
Expand All @@ -13,10 +11,10 @@ export default (currentState: any): RoarrGlobalState => {

versions.sort(cmp);

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

if (!versions.includes(version)) {
versions.push(version);
if (!versions.includes(pkg.version)) {
versions.push(pkg.version);
}

versions.sort(cmp);
Expand Down

0 comments on commit cadd1b2

Please sign in to comment.