diff --git a/src/lib/hooks/usePermissions.ts b/src/lib/hooks/usePermissions.ts index 9cb4a80d..138f3eac 100644 --- a/src/lib/hooks/usePermissions.ts +++ b/src/lib/hooks/usePermissions.ts @@ -29,9 +29,14 @@ export function usePhotoLibraryPermission() { if (res?.granted) { return true - } else if (!res || res?.status === 'undetermined' || res?.canAskAgain) { - const updatedRes = await requestPermission() - return updatedRes?.granted + } else if (!res || res.status === 'undetermined' || res?.canAskAgain) { + const {canAskAgain, granted, status} = await requestPermission() + + if (!canAskAgain && status === 'undetermined') { + openPermissionAlert('photo library') + } + + return granted } else { openPermissionAlert('photo library') return false