[INJIMOB-2018] add vc download success banner (#1646)

[INJIMOB-1852] fix caching logic, to use cache if the device is offline

Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>
This commit is contained in:
abhip2565
2024-10-21 11:03:31 +05:30
committed by GitHub
parent aff5c169b2
commit 6e5c14b1fe
10 changed files with 41 additions and 5 deletions

View File

@@ -15,6 +15,7 @@ import {
sendImpressionEvent,
} from './telemetry/TelemetryUtils';
import {TelemetryConstants} from './telemetry/TelemetryConstants';
import NetInfo, {NetInfoState} from '@react-native-community/netinfo';
export const API_URLS: ApiUrls = {
trustedVerifiersList: {
@@ -257,9 +258,10 @@ async function generateCacheAPIFunctionWithAPIPreference(
}`);
console.log(error);
const response = await getItem(cacheKey, null, '');
var response=null;
if(!(await NetInfo.fetch()).isConnected){
response = await getItem(cacheKey, null, '');
}
if (response) {
return response;
} else {