aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/constants/api.ts2
-rw-r--r--src/routes/Routes.tsx6
-rw-r--r--src/services/CommonService.ts2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/constants/api.ts b/src/constants/api.ts
index 1463683f..07fa2b59 100644
--- a/src/constants/api.ts
+++ b/src/constants/api.ts
@@ -4,7 +4,7 @@ const BASE_URL: string = 'http://127.0.0.1:8000/'; // local server
const API_URL: string = BASE_URL + 'api/';
export const LOGIN_ENDPOINT: string = API_URL + 'login/';
-export const VERSION_ENDPOINT: string = API_URL + 'version/';
+export const VERSION_ENDPOINT: string = API_URL + 'version/v2/';
export const REGISTER_ENDPOINT: string = API_URL + 'register/';
export const EDIT_PROFILE_ENDPOINT: string = API_URL + 'edit-profile/';
export const SEND_OTP_ENDPOINT: string = API_URL + 'send-otp/';
diff --git a/src/routes/Routes.tsx b/src/routes/Routes.tsx
index 1cbc9bc5..c7b9aeee 100644
--- a/src/routes/Routes.tsx
+++ b/src/routes/Routes.tsx
@@ -3,7 +3,7 @@ import React, {useEffect, useState} from 'react';
import DeviceInfo from 'react-native-device-info';
import SplashScreen from 'react-native-splash-screen';
import {useDispatch, useSelector} from 'react-redux';
-import {fcmService, getLiveVersion} from '../services';
+import {fcmService, getCurrentLiveVersions} from '../services';
import {
updateNewNotificationReceived,
updateNewVersionAvailable,
@@ -54,8 +54,8 @@ const Routes: React.FC = () => {
useEffect(() => {
const checkVersion = async () => {
- const liveVersion = await getLiveVersion();
- if (liveVersion && liveVersion !== DeviceInfo.getVersion()) {
+ const liveVersions = await getCurrentLiveVersions();
+ if (liveVersions && !liveVersions.includes(DeviceInfo.getVersion())) {
setNewVersionAvailable(true);
dispatch(updateNewVersionAvailable(true));
}
diff --git a/src/services/CommonService.ts b/src/services/CommonService.ts
index 9fa7417f..5bc1174d 100644
--- a/src/services/CommonService.ts
+++ b/src/services/CommonService.ts
@@ -22,7 +22,7 @@ export const loadImageFromURL = async (url: string) => {
}
};
-export const getLiveVersion = async () => {
+export const getCurrentLiveVersions = async () => {
try {
const response = await fetch(VERSION_ENDPOINT, {method: 'GET'});
return response.status === 200 ? await response.json() : undefined;