Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function takePhotoAsync(): Promise {
if (!(await ensurePermissionsAsync())) return null;
const media = await ImagePicker.launchCameraAsync(mediaOptions);
if (!media.cancelled) {
const asset = await MediaLibrary.createAssetAsync(media.uri);
return await moveToPhotoCacheAsync(asset.uri);
}
return null;
}
const promises = photos.map(photoUri => {
return MediaLibrary.createAssetAsync(photoUri);
});
const promises = photos.map(photoUri => {
return MediaLibrary.createAssetAsync(photoUri);
});