Fixed #1922 UI shows incorrect wrong major version in version history. (#1928)

This commit is contained in:
Sachin Chaurasiya 2021-12-27 12:02:36 +05:30 committed by GitHub
parent 9ff0fdc533
commit c925168f65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -534,5 +534,12 @@ export const getSummary = (
};
export const isMajorVersion = (version1: string, version2: string) => {
return version2.split('.')[0] > version1.split('.')[0];
const v1 = parseFloat(version1);
const v2 = parseFloat(version2);
const flag = !isNaN(v1) && !isNaN(v2);
if (flag) {
return v1 + 1 === v2;
}
return flag;
};