fix: Fix playing Shutter Sound in Scan Receipt#39400
fix: Fix playing Shutter Sound in Scan Receipt#39400mountiny merged 11 commits intoExpensify:mainfrom
Conversation
| const device = useCameraDevice('back', { | ||
| physicalDevices: ['wide-angle-camera'], | ||
| }); | ||
| const [user] = useOnyx(ONYXKEYS.USER) |
There was a problem hiding this comment.
should I use a selector for only isMutedAllSounds here, or is this fine?
There was a problem hiding this comment.
I dont think we can use useOnyx yet, please use selector
There was a problem hiding this comment.
How would that look like then? Onyx.connect(...)?
There was a problem hiding this comment.
@mountiny what is the reason we shouldn't use `useOnyx yet?
| const device = useCameraDevice('back', { | ||
| physicalDevices: ['wide-angle-camera'], | ||
| }); | ||
| const [user] = useOnyx(ONYXKEYS.USER) |
There was a problem hiding this comment.
I dont think we can use useOnyx yet, please use selector
| import * as IOU from '@userActions/IOU'; | ||
| import CONST from '@src/CONST'; | ||
| import ROUTES from '@src/ROUTES'; | ||
| import Onyx, {useOnyx} from 'react-native-onyx'; |
There was a problem hiding this comment.
| import Onyx, {useOnyx} from 'react-native-onyx'; | |
| import {withOnyx} from 'react-native-onyx'; |
| const device = useCameraDevice('back', { | ||
| physicalDevices: ['wide-angle-camera'], | ||
| }); | ||
| const [user] = useOnyx(ONYXKEYS.USER) |
There was a problem hiding this comment.
| const [user] = useOnyx(ONYXKEYS.USER) |
c3024
left a comment
There was a problem hiding this comment.
transaction: {isFromGlobalCreate},
userat
export default compose(withWritableReportOrNotFound, withFullTransactionOrNotFound, withOnyx({
user: {
key: ONYXKEYS.USER,
}
}))(IOURequestStepScan);at
report: {},
transaction: {},
user: {}App/src/pages/iou/request/step/IOURequestStepScan/index.native.js Lines 52 to 53 in d7a50d4 |
|
There is shutter sound even when |
|
@c3024 are you by any chance in Japan? Maybe the |
|
No, I am in India. The phone is a Xiaomi. The camera app of the device has an option to disable shutter sound. Disabling it disables the shutter sound in the camera app. So, I think this might not be happening due to regional restrictions. But shutter sound plays when sounds are muted in settings in New Expensify app. |
|
Can you check your Look for something like: |
|
Well I guess then I'll just remove that check, seems to be ignored? |
|
Not sure how to proceed with the mustPlayShutterSound() - per documentation it is a regional restriction (often a law, eg Japan) to play a shutter sound when this value is true. I can of course take it out, it probably won't cause any trouble. Just need to know |
|
@mountiny I see many apps disregard this requirement. I think we can remove that check. Could you confirm this? |
|
Released 4.0.0-beta.13 that doesn't use @chrispader can you update the version in E/App? |
|
|
||
| /** Information about the logged in user's account */ | ||
| user: PropTypes.shape({ | ||
| /** Whether or not the user is on a public domain email account or not */ |
There was a problem hiding this comment.
| /** Whether or not the user is on a public domain email account or not */ | |
| /** Whether user muted all sounds in application */ |
|
@mountiny could you add |
Reviewer Checklist
Screenshots/VideosAndroid: NativeshutterAndroid-compressed.mp4Android: mWeb ChromeiOS: NativeshutteriOS-compressed.mp4iOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
Running the build |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
mountiny
left a comment
There was a problem hiding this comment.
Thanks @chrispader @mrousavy @c3024
Going to go ahead and merge this now that John also approved
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.61-0 🚀
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.61-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.61-8 🚀
|

Details
Fixes playing shutter sound in scan receipt page when:
Fixed Issues
$ #39241
PROPOSAL:
Tests
Offline tests
None needed.
QA Steps
Same as in Tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen_Recording_20240403_161420_New_Expensify_Dev.mp4
Screen_Recording_20240403_161452_New_Expensify_Dev.mp4
Android: mWeb Chrome
iOS: Native
RPReplay_Final1712153932.mov
RPReplay_Final1712153897.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop
Only provided screen captures for iOS and Android. Web not affected