-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Fix playing Shutter Sound in Scan Receipt #39400
fix: Fix playing Shutter Sound in Scan Receipt #39400
Conversation
@@ -63,6 +65,7 @@ function IOURequestStepScan({ | |||
const device = useCameraDevice('back', { | |||
physicalDevices: ['wide-angle-camera'], | |||
}); | |||
const [user] = useOnyx(ONYXKEYS.USER) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should I use a selector for only isMutedAllSounds
here, or is this fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think we can use useOnyx yet, please use selector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would that look like then? Onyx.connect(...)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mountiny what is the reason we shouldn't use `useOnyx yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ntdiary Will you be able to review this one quickly?
@@ -63,6 +65,7 @@ function IOURequestStepScan({ | |||
const device = useCameraDevice('back', { | |||
physicalDevices: ['wide-angle-camera'], | |||
}); | |||
const [user] = useOnyx(ONYXKEYS.USER) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think we can use useOnyx yet, please use selector
@@ -31,6 +31,8 @@ import reportPropTypes from '@pages/reportPropTypes'; | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import Onyx, {useOnyx} from 'react-native-onyx'; | |
import {withOnyx} from 'react-native-onyx'; |
@@ -63,6 +65,7 @@ function IOURequestStepScan({ | |||
const device = useCameraDevice('back', { | |||
physicalDevices: ['wide-angle-camera'], | |||
}); | |||
const [user] = useOnyx(ONYXKEYS.USER) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const [user] = useOnyx(ONYXKEYS.USER) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transaction: {isFromGlobalCreate},
user
at
transaction: {isFromGlobalCreate}, |
export default compose(withWritableReportOrNotFound, withFullTransactionOrNotFound, withOnyx({
user: {
key: ONYXKEYS.USER,
}
}))(IOURequestStepScan);
at
export default compose(withWritableReportOrNotFound, withFullTransactionOrNotFound)(IOURequestStepScan); |
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? |
@@ -42,6 +45,12 @@ const propTypes = { | |||
/** The report that the transaction belongs to */ | |||
report: reportPropTypes, | |||
|
|||
/** 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** 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! 🧪🧪 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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