mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

use granular permission of for media perm request (#4609)

authored by hailey.at and committed by

GitHub 873d91d4 77a512ae

+7 -3
+3 -1
src/lib/hooks/usePermissions.ts
··· 20 20 } 21 21 22 22 export function usePhotoLibraryPermission() { 23 - const [res, requestPermission] = MediaLibrary.usePermissions() 23 + const [res, requestPermission] = MediaLibrary.usePermissions({ 24 + granularPermissions: ['photo'], 25 + }) 24 26 const requestPhotoAccessIfNeeded = async () => { 25 27 // On the, we use <input type="file"> to produce a filepicker 26 28 // This does not need any permission granting.
+1 -1
src/view/com/composer/photos/OpenCameraBtn.tsx
··· 24 24 const {_} = useLingui() 25 25 const {requestCameraAccessIfNeeded} = useCameraPermission() 26 26 const [mediaPermissionRes, requestMediaPermission] = 27 - MediaLibrary.usePermissions() 27 + MediaLibrary.usePermissions({granularPermissions: ['photo']}) 28 28 const t = useTheme() 29 29 30 30 const onPressTakePicture = useCallback(async () => {
+3 -1
src/view/com/lightbox/Lightbox.tsx
··· 59 59 const {_} = useLingui() 60 60 const {activeLightbox} = useLightbox() 61 61 const [isAltExpanded, setAltExpanded] = React.useState(false) 62 - const [permissionResponse, requestPermission] = MediaLibrary.usePermissions() 62 + const [permissionResponse, requestPermission] = MediaLibrary.usePermissions({ 63 + granularPermissions: ['photo'], 64 + }) 63 65 64 66 const saveImageToAlbumWithToasts = React.useCallback( 65 67 async (uri: string) => {