diff --git a/src/caj/helper/storage/appData.ts b/src/caj/helper/storage/appData.ts index 18a451a..ff1838e 100644 --- a/src/caj/helper/storage/appData.ts +++ b/src/caj/helper/storage/appData.ts @@ -1,7 +1,12 @@ import EncryptedStorage from 'react-native-encrypted-storage'; export async function getData(key: string): Promise { - return EncryptedStorage.getItem(key); + return new Promise((resolve, reject) => { + EncryptedStorage.getItem(key).then(value => { + if (value === undefined) resolve(null); + else resolve(value); + }); + }); } export async function setData(key: string, value: string): Promise {