diff --git a/Gemfile.lock b/Gemfile.lock index beb2c176293..e1b4fc2ec7e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,11 +3,12 @@ GEM specs: CFPropertyList (3.0.6) rexml - activesupport (7.0.8) + activesupport (6.1.7.7) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) + zeitwerk (~> 2.3) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) algoliasearch (1.27.5) @@ -80,7 +81,8 @@ GEM declarative (0.0.20) digest-crc (0.6.5) rake (>= 12.0.0, < 14.0.0) - domain_name (0.6.20240107) + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) dotenv (2.8.1) emoji_regex (3.2.3) escape (0.0.4) @@ -187,11 +189,11 @@ GEM google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) google-cloud-errors (1.3.1) - google-cloud-storage (1.47.0) + google-cloud-storage (1.37.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.31.0) + google-apis-storage_v1 (~> 0.1) google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) @@ -260,6 +262,9 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.9.1) unicode-display_width (2.5.0) word_wrap (1.0.0) xcodeproj (1.23.0) @@ -273,6 +278,7 @@ GEM rouge (~> 2.0.7) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) + zeitwerk (2.6.13) PLATFORMS arm64-darwin-21 @@ -292,4 +298,4 @@ RUBY VERSION ruby 2.6.10p210 BUNDLED WITH - 2.4.19 + 2.3.22 diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 24ef0704be2..8d388ebd823 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1415,7 +1415,7 @@ PODS: - SDWebImage/Core (~> 5.17) - SocketRocket (0.6.1) - Turf (2.7.0) - - VisionCamera (4.0.0-beta.11): + - VisionCamera (4.0.0-beta.13): - React - React-callinvoker - React-Core @@ -1920,7 +1920,7 @@ SPEC CHECKSUMS: SDWebImageWebPCoder: af09429398d99d524cae2fe00f6f0f6e491ed102 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 Turf: 13d1a92d969ca0311bbc26e8356cca178ce95da2 - VisionCamera: b6b6f46949eae83b71429c971162af337ef34fa3 + VisionCamera: 9f26224fce1233ffdad9fa4e56863e3de2190dc0 Yoga: e64aa65de36c0832d04e8c7bd614396c77a80047 PODFILE CHECKSUM: a431c146e1501391834a2f299a74093bac53b530 diff --git a/package-lock.json b/package-lock.json index a426fab95d0..5ea61a5f593 100644 --- a/package-lock.json +++ b/package-lock.json @@ -114,7 +114,7 @@ "react-native-tab-view": "^3.5.2", "react-native-url-polyfill": "^2.0.0", "react-native-view-shot": "3.8.0", - "react-native-vision-camera": "^4.0.0-beta.11", + "react-native-vision-camera": "^4.0.0-beta.13", "react-native-web": "^0.19.9", "react-native-web-linear-gradient": "^1.1.2", "react-native-web-sound": "^0.1.3", @@ -39769,9 +39769,9 @@ } }, "node_modules/react-native-vision-camera": { - "version": "4.0.0-beta.11", - "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-4.0.0-beta.11.tgz", - "integrity": "sha512-cKg/nwT0q0H1ivEVG+PQt/QxhFgf/dd7SiMm7bCzlSCmt0T2tXyIdLsuY312iKBB2qasQZOYtzRsoQjipHQkDw==", + "version": "4.0.0-beta.13", + "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-4.0.0-beta.13.tgz", + "integrity": "sha512-a5ypYsr9XsERfx2UCmL1oSMC/Irra6X0Ixv0/hCgM/2ndt/aK94A6FwONr1kA/GRyU67ekOhk8HwUfxx+hi6dQ==", "peerDependencies": { "react": "*", "react-native": "*", diff --git a/package.json b/package.json index bad551b1282..2227eb47c59 100644 --- a/package.json +++ b/package.json @@ -165,7 +165,7 @@ "react-native-tab-view": "^3.5.2", "react-native-url-polyfill": "^2.0.0", "react-native-view-shot": "3.8.0", - "react-native-vision-camera": "^4.0.0-beta.11", + "react-native-vision-camera": "^4.0.0-beta.13", "react-native-web": "^0.19.9", "react-native-web-linear-gradient": "^1.1.2", "react-native-web-sound": "^0.1.3", diff --git a/src/pages/iou/request/step/IOURequestStepScan/index.native.js b/src/pages/iou/request/step/IOURequestStepScan/index.native.js index 738fbb00167..f3c02db8123 100644 --- a/src/pages/iou/request/step/IOURequestStepScan/index.native.js +++ b/src/pages/iou/request/step/IOURequestStepScan/index.native.js @@ -1,8 +1,10 @@ import {useFocusEffect} from '@react-navigation/core'; import lodashGet from 'lodash/get'; +import PropTypes from 'prop-types'; import React, {useCallback, useRef, useState} from 'react'; import {ActivityIndicator, Alert, AppState, InteractionManager, View} from 'react-native'; import {Gesture, GestureDetector} from 'react-native-gesture-handler'; +import {withOnyx} from 'react-native-onyx'; import {RESULTS} from 'react-native-permissions'; import Animated, {runOnJS, useAnimatedStyle, useSharedValue, withDelay, withSequence, withSpring, withTiming} from 'react-native-reanimated'; import {useCameraDevice} from 'react-native-vision-camera'; @@ -30,6 +32,7 @@ import withWritableReportOrNotFound from '@pages/iou/request/step/withWritableRe import reportPropTypes from '@pages/reportPropTypes'; import * as IOU from '@userActions/IOU'; import CONST from '@src/CONST'; +import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import * as CameraPermission from './CameraPermission'; import NavigationAwareCamera from './NavigationAwareCamera'; @@ -42,17 +45,25 @@ const propTypes = { /** The report that the transaction belongs to */ report: reportPropTypes, + /** Information about the logged in user's account */ + user: PropTypes.shape({ + /** Whether user muted all sounds in the application */ + isMutedAllSounds: PropTypes.bool, + }), + /** The transaction (or draft transaction) being changed */ transaction: transactionPropTypes, }; const defaultProps = { report: {}, + user: {}, transaction: {}, }; function IOURequestStepScan({ report, + user, route: { params: {action, iouType, reportID, transactionID, backTo}, }, @@ -245,6 +256,7 @@ function IOURequestStepScan({ return camera.current .takePhoto({ flash: flash && hasFlash ? 'on' : 'off', + enableShutterSound: !user.isMutedAllSounds, }) .then((photo) => { // Store the receipt on the transaction object in Onyx @@ -266,7 +278,7 @@ function IOURequestStepScan({ showCameraAlert(); Log.warn('Error taking photo', error); }); - }, [flash, hasFlash, action, translate, transactionID, updateScanAndNavigate, navigateToConfirmationStep, cameraPermissionStatus, didCapturePhoto]); + }, [cameraPermissionStatus, didCapturePhoto, flash, hasFlash, user.isMutedAllSounds, translate, transactionID, action, navigateToConfirmationStep, updateScanAndNavigate]); // Wait for camera permission status to render if (cameraPermissionStatus == null) { @@ -390,4 +402,12 @@ IOURequestStepScan.defaultProps = defaultProps; IOURequestStepScan.propTypes = propTypes; IOURequestStepScan.displayName = 'IOURequestStepScan'; -export default compose(withWritableReportOrNotFound, withFullTransactionOrNotFound)(IOURequestStepScan); +export default compose( + withWritableReportOrNotFound, + withFullTransactionOrNotFound, + withOnyx({ + user: { + key: ONYXKEYS.USER, + }, + }), +)(IOURequestStepScan);