Skip to content

Commit

Permalink
fix lint on main
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins committed Oct 11, 2023
1 parent bbb5728 commit 4b6b39e
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/pages/iou/ReceiptSelector/index.native.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ActivityIndicator, Alert, AppState, Linking, Text, View} from 'react-native';
import {ActivityIndicator, Alert, AppState, Text, View, Linking} from 'react-native';
import React, {useCallback, useEffect, useRef, useState} from 'react';
import {useCameraDevices} from 'react-native-vision-camera';
import lodashGet from 'lodash/get';
Expand Down Expand Up @@ -102,6 +102,27 @@ function ReceiptSelector({route, report, iou, transactionID, isInTabNavigator})
};
}, []);

/**
* Inform the users when they need to grant camera access and guide them to settings
*/
const showPermissionsAlert = useCallback(() => {
Alert.alert(
translate('attachmentPicker.cameraPermissionRequired'),
translate('attachmentPicker.expensifyDoesntHaveAccessToCamera'),
[
{
text: translate('common.cancel'),
style: 'cancel',
},
{
text: translate('common.settings'),
onPress: () => Linking.openSettings(),
},
],
{cancelable: false},
);
}, [translate]);

const askForPermissions = () => {
// There's no way we can check for the BLOCKED status without requesting the permission first
// https://github.com/zoontek/react-native-permissions/blob/a836e114ce3a180b2b23916292c79841a267d828/README.md?plain=1#L670
Expand Down

0 comments on commit 4b6b39e

Please sign in to comment.