mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 21:48:04 -05:00
[INJIMOB-1874] add ecr1,eck1 and ed key support (#1594)
* [INJIMOB-1874] add ecr1,eck1 and ed key support Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> * [INJIMOB-1874] refactor changes Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> [INJIMOB-1874] refactor changes Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com> --------- Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>
This commit is contained in:
@@ -5,7 +5,6 @@ import {
|
||||
COMMON_PROPS_KEY,
|
||||
} from './constants';
|
||||
import {INITIAL_CONFIG} from './InitialConfig';
|
||||
import Keychain from 'react-native-keychain';
|
||||
import {getItem, setItem} from '../machines/store';
|
||||
import {faceMatchConfig} from './commonUtil';
|
||||
import {configure} from '@iriscan/biometric-sdk-react-native';
|
||||
@@ -193,19 +192,18 @@ async function generateCacheAPIFunctionWithCachePreference(
|
||||
fetchCall: (...props: any[]) => any,
|
||||
onErrorHardCodedValue?: any,
|
||||
) {
|
||||
const existingCredentials = await Keychain.getGenericPassword();
|
||||
try {
|
||||
const response = await getItem(
|
||||
cacheKey,
|
||||
null,
|
||||
existingCredentials?.password,
|
||||
""
|
||||
);
|
||||
|
||||
if (response) {
|
||||
return response;
|
||||
} else {
|
||||
const response = await fetchCall();
|
||||
setItem(cacheKey, response, existingCredentials?.password).then(() =>
|
||||
setItem(cacheKey, response, "").then(() =>
|
||||
console.log('Cached response for ' + cacheKey),
|
||||
);
|
||||
|
||||
@@ -231,10 +229,10 @@ async function generateCacheAPIFunctionWithAPIPreference(
|
||||
fetchCall: (...props: any[]) => any,
|
||||
onErrorHardCodedValue?: any,
|
||||
) {
|
||||
const existingCredentials = await Keychain.getGenericPassword();
|
||||
|
||||
try {
|
||||
const response = await fetchCall();
|
||||
setItem(cacheKey, response, existingCredentials.password).then(() =>
|
||||
setItem(cacheKey, response, "").then(() =>
|
||||
console.log('Cached response for ' + cacheKey),
|
||||
);
|
||||
return response;
|
||||
@@ -249,7 +247,7 @@ async function generateCacheAPIFunctionWithAPIPreference(
|
||||
const response = await getItem(
|
||||
cacheKey,
|
||||
null,
|
||||
existingCredentials.password,
|
||||
""
|
||||
);
|
||||
|
||||
if (response) {
|
||||
|
||||
Reference in New Issue
Block a user