+ client: add isVersionGreater helper

This commit is contained in:
Ildar Kamalov 2019-09-17 17:37:26 +03:00
parent 0a26ee4224
commit 59a635f3f2
3 changed files with 9 additions and 5 deletions
client/src/helpers

View file

@ -7,6 +7,7 @@ import subDays from 'date-fns/sub_days';
import round from 'lodash/round';
import axios from 'axios';
import i18n from 'i18next';
import versionCompare from './versionCompare';
import {
STANDARD_DNS_PORT,
@ -279,3 +280,7 @@ export const secondsToMilliseconds = (seconds) => {
};
export const normalizeRulesTextarea = text => text && text.replace(/^\n/g, '').replace(/\n\s*\n/g, '\n');
export const isVersionGreater = (currentVersion, previousVersion) => (
versionCompare(currentVersion, previousVersion) === -1
);