Merge pull request #1334 from bluesky-social/eric/fix-android-perms-noop
handle stuck state with granular android permissions
This commit is contained in:
commit
22b7964b5e
1 changed files with 8 additions and 3 deletions
|
@ -29,9 +29,14 @@ export function usePhotoLibraryPermission() {
|
||||||
|
|
||||||
if (res?.granted) {
|
if (res?.granted) {
|
||||||
return true
|
return true
|
||||||
} else if (!res || res?.status === 'undetermined' || res?.canAskAgain) {
|
} else if (!res || res.status === 'undetermined' || res?.canAskAgain) {
|
||||||
const updatedRes = await requestPermission()
|
const {canAskAgain, granted, status} = await requestPermission()
|
||||||
return updatedRes?.granted
|
|
||||||
|
if (!canAskAgain && status === 'undetermined') {
|
||||||
|
openPermissionAlert('photo library')
|
||||||
|
}
|
||||||
|
|
||||||
|
return granted
|
||||||
} else {
|
} else {
|
||||||
openPermissionAlert('photo library')
|
openPermissionAlert('photo library')
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue