File tree Expand file tree Collapse file tree
modules/core/application/permissions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,7 +104,10 @@ export function ImagePicker({
104104 selectionLimit : 1 ,
105105 } ;
106106
107- const result = await checkLibrary ( ) ;
107+ // On Android, we skip permission check, because it's not required (Photo Picker Everywhere)
108+ // Since Android 11(API 30)
109+ const skip = Platform . OS === 'android' ;
110+ const result = await checkLibrary ( skip ) ;
108111 if ( result . status === 'granted' ) {
109112 launchImageLibrary ( options , handleImageResponse ) ;
110113 } else {
Original file line number Diff line number Diff line change @@ -42,23 +42,34 @@ export function usePermission(type: PermissionType) {
4242 return result ;
4343 } , [ type ] ) ;
4444
45- const checkAndRequest = useCallback ( async ( ) => {
46- setIsLoading ( true ) ;
47- const result = await permissionsService . checkAndRequest ( type ) ;
48- setIsLoading ( false ) ;
49- if ( result instanceof Error ) {
50- setStatus ( 'unavailable' ) ;
51- setCanAskAgain ( false ) ;
52- return {
53- type,
54- status : 'unavailable' as PermissionStatus ,
55- canAskAgain : false ,
56- } ;
57- }
58- setStatus ( result . status ) ;
59- setCanAskAgain ( result . canAskAgain ) ;
60- return result ;
61- } , [ type ] ) ;
45+ const checkAndRequest = useCallback (
46+ async ( skip ?: boolean ) => {
47+ if ( skip ) {
48+ return {
49+ type,
50+ status : 'granted' as PermissionStatus ,
51+ canAskAgain : false ,
52+ } ;
53+ }
54+
55+ setIsLoading ( true ) ;
56+ const result = await permissionsService . checkAndRequest ( type ) ;
57+ setIsLoading ( false ) ;
58+ if ( result instanceof Error ) {
59+ setStatus ( 'unavailable' ) ;
60+ setCanAskAgain ( false ) ;
61+ return {
62+ type,
63+ status : 'unavailable' as PermissionStatus ,
64+ canAskAgain : false ,
65+ } ;
66+ }
67+ setStatus ( result . status ) ;
68+ setCanAskAgain ( result . canAskAgain ) ;
69+ return result ;
70+ } ,
71+ [ type ] ,
72+ ) ;
6273
6374 const openSettings = useCallback ( async ( ) => {
6475 await permissionsService . openSettings ( ) ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { useCallback, useRef } from 'react';
22import { Animated } from 'react-native' ;
33import { useFocusEffect } from '@react-navigation/native' ;
44import { ANIMATION_DURATION } from '../animations' ;
5+ import { isIOS } from '@theme/responsive' ;
56
67interface FocusFadeInConfig {
78 duration ?: number ;
@@ -14,11 +15,11 @@ export function useFocusFadeIn({
1415 delay = 0 ,
1516 offset = 20 ,
1617} : FocusFadeInConfig = { } ) {
17- const opacity = useRef ( new Animated . Value ( 0 ) ) . current ;
18- const translateY = useRef ( new Animated . Value ( offset ) ) . current ;
19-
18+ const opacity = useRef ( new Animated . Value ( isIOS ? 1 : 0 ) ) . current ;
19+ const translateY = useRef ( new Animated . Value ( isIOS ? 0 : offset ) ) . current ;
2020 useFocusEffect (
2121 useCallback ( ( ) => {
22+ if ( isIOS ) return ;
2223 opacity . setValue ( 0 ) ;
2324 translateY . setValue ( offset ) ;
2425
You can’t perform that action at this time.
0 commit comments