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
+1
View File
@@ -21,6 +21,7 @@
"expo-file-system": "~11.0.2",
"expo-font": "~9.1.0",
"expo-haptics": "~10.0.0",
"expo-keep-awake": "~9.1.2",
"expo-linear-gradient": "~9.1.0",
"expo-linking": "~2.2.3",
"expo-notifications": "~0.11.6",
+1
View File
@@ -19,6 +19,7 @@
"expo-file-system": "~11.0.2",
"expo-font": "~9.1.0",
"expo-haptics": "~10.0.0",
"expo-keep-awake": "~9.1.2",
"expo-linear-gradient": "~9.1.0",
"expo-linking": "~2.2.3",
"expo-notifications": "~0.11.6",
+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;
};
+4 -3
View File
@@ -1,4 +1,5 @@
import React from 'react';
import {ScrollView} from 'react-native';
import * as Linking from 'expo-linking';
import {useSelector} from 'react-redux';
@@ -6,7 +7,7 @@ import {useSelector} from 'react-redux';
import {List} from '../../components/List';
import {ScreenContainer} from '../../components/Common';
import {MoreHeader} from './components/MoreHeader';
import {ScrollView} from 'react-native';
import {appversion, releasedt} from '../../utils/utils';
const AboutScreen = ({navigation}) => {
const theme = useSelector(state => state.settingsReducer.theme);
@@ -23,14 +24,14 @@ const AboutScreen = ({navigation}) => {
<List.Section>
<List.Item
title="Version"
description="Stable 1.1.7 (01/11/21 10:00 AM)"
description={`Stable ${appversion} (${releasedt})`}
theme={theme}
/>
<List.Item
title="What's new"
onPress={() =>
Linking.openURL(
'https://github.com/LNReader/lnreader/releases/tag/v1.1.7',
`https://github.com/LNReader/lnreader/releases/tag/v${appversion}`,
)
}
theme={theme}
+5
View File
@@ -0,0 +1,5 @@
const app_version = '1.1.7';
const release_dt = '01/11/21 10:00 AM';
export const releasedt = release_dt;
export const appversion = app_version;