Utils for version (#129)

* ESLint Error Fixed

* Utils for version

* Remove useKeepAwake

* Update Main.js

Co-authored-by: Rajarshee Chatterjee <rajarshee.adm@gmail.com>
This commit is contained in:
Pushpender Singh
2021-12-21 16:26:20 +05:30
committed by GitHub
parent ab4fc42f69
commit 3522b7e06d
5 changed files with 14 additions and 7 deletions
+3 -4
View File
@@ -1,6 +1,5 @@
import {useState, useEffect} from 'react';
import {showToast} from './../hooks/showToast';
import {appversion} from '../utils/utils';
export const useGithubUpdateChecker = () => {
const latestReleaseUrl =
@@ -24,11 +23,11 @@ export const useGithubUpdateChecker = () => {
};
const isNewVersion = versionTag => {
let currentVersion = 'v1.1.7';
let currentVersion = `${appversion}`;
const regex = /[^\\d.]/;
let newVersion = versionTag.replace(regex, '');
currentVersion = currentVersion.replace(regex, '');
currentVersion = currentVersion;
return newVersion !== currentVersion;
};