Files
inji-wallet/shared/commonprops/commonProps.ts
2023-01-19 15:10:56 +05:30

29 lines
832 B
TypeScript

import { request } from '../request';
import AsyncStorage from '@react-native-async-storage/async-storage';
const COMMON_PROPS_KEY: string =
'CommonPropsKey-' + '6964d04a-9268-11ed-a1eb-0242ac120002';
export default async function getAllConfigurations() {
try {
var response = await AsyncStorage.getItem(COMMON_PROPS_KEY);
if (response) {
return JSON.parse(response);
} else {
const resp = await request('GET', '/residentmobileapp/allProperties');
const injiProps = resp.response;
const injiPropsString = JSON.stringify(injiProps);
await AsyncStorage.setItem(COMMON_PROPS_KEY, injiPropsString);
return injiProps;
}
} catch (error) {
console.log(error);
throw error;
}
}
export interface DownloadProps {
maxDownloadLimit: number;
downloadInterval: number;
}