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.

handle stuck state with granular android permissions

+8 -3
+8 -3
src/lib/hooks/usePermissions.ts
··· 29 29 30 30 if (res?.granted) { 31 31 return true 32 - } else if (!res || res?.status === 'undetermined' || res?.canAskAgain) { 33 - const updatedRes = await requestPermission() 34 - return updatedRes?.granted 32 + } else if (!res || res.status === 'undetermined' || res?.canAskAgain) { 33 + const {canAskAgain, granted, status} = await requestPermission() 34 + 35 + if (!canAskAgain && status === 'undetermined') { 36 + openPermissionAlert('photo library') 37 + } 38 + 39 + return granted 35 40 } else { 36 41 openPermissionAlert('photo library') 37 42 return false