alpha
Jan Umbach 2023-03-06 23:32:33 +01:00
parent a89455f887
commit 7fcd1148cb
1 changed files with 6 additions and 1 deletions

View File

@ -1,7 +1,12 @@
import EncryptedStorage from 'react-native-encrypted-storage';
export async function getData(key: string): Promise<string | null> {
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<void> {