feat: check if image was selected
This commit is contained in:
parent
0d8610a969
commit
c0761c9623
1 changed files with 6 additions and 1 deletions
|
|
@ -9,12 +9,17 @@ import { UserPhoto } from '@components/UserPhoto';
|
||||||
|
|
||||||
export function Profile() {
|
export function Profile() {
|
||||||
async function handleUserPhotoSelection() {
|
async function handleUserPhotoSelection() {
|
||||||
await ImagePicker.launchImageLibraryAsync({
|
const photoSelection = await ImagePicker.launchImageLibraryAsync({
|
||||||
mediaTypes: ImagePicker.MediaTypeOptions.Images,
|
mediaTypes: ImagePicker.MediaTypeOptions.Images,
|
||||||
quality: 1,
|
quality: 1,
|
||||||
aspect: [4, 4],
|
aspect: [4, 4],
|
||||||
allowsEditing: true,
|
allowsEditing: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (photoSelection.canceled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.debug(JSON.stringify(photoSelection.assets[0], null, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue