-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Use platform specific mute setting for sounds #52088
Use platform specific mute setting for sounds #52088
Conversation
src/libs/Sound/BaseSound.ts
Outdated
callback: (val) => (isMuted = !!val?.isMutedAllSounds), | ||
key: ONYXKEYS.NVP_MUTED_PLATFORMS, | ||
callback: (val) => { | ||
const platform = Browser.isMobile() ? CONST.PLATFORM.MOBILEWEB : getPlatform(); |
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.
This isn't very DRY, should we maybe spin this out into a function (it will avoid problems in future too)?
@c3024 So for this issue |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-app-2024-11-06_13.38.45.mp4Android: mWeb Chromeandroid-chrome-2024-11-06_13.40.38.mp4iOS: Nativeios-app-2024-11-06_14.01.56.mp4iOS: mWeb Safariios-safari-2024-11-06_13.49.53.mp4MacOS: Chrome / Safaridesktop-chrome-2024-11-06_13.32.17.mp4MacOS: Desktopdesktop-app-2024-11-06_13.35.47.mp4 |
I think @mallenexpensify found that there were still sounds even after muting. I think he did not check the toggling of the setting in preferences page. It must be working fine but sounds were not disabled. |
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.
Just need to DRY up code & add missing screenshots. Thanks! 🙏
Done. Please have a look! |
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! Thanks for the fix!
src/libs/getPlatform/index.ts
Outdated
import CONST from '@src/CONST'; | ||
import type Platform from './types'; | ||
|
||
export default function getPlatform(): Platform { | ||
export default function getPlatform(treatMWebDifferently = false): Platform { |
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.
Would you mind renaming this param to shouldMobileWebBeDistinctFromWeb
?
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.
Done. And I was thinking for a smaller name because treatMWebDifferently
was already mouthful.
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.
Variable naming is one of the hardest things! Luckily code-minifiers usually render the name length insignificant in the end, so I prefer more clarity. Thanks!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/tgolen in version: 9.0.59-0 🚀
|
Explanation of Change
This PR uses the platform specific mute settings for sounds. This is a followup PR for #50493 to fix these issues.
Fixed Issues
$ #49087
PROPOSAL: NA
Tests
Same as QA tests
Offline tests
None
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Test 1:
Test 2:
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
soundAndroid-compressed.mp4
Android: mWeb Chrome
soundMWebAndroid-compressed.mp4
iOS: Native
soundiOS.mp4
iOS: mWeb Safari
soundmWebiOS-compressed.mp4
MacOS: Chrome / Safari
muteSoundChrome.mp4
MacOS: Desktop
soundDesktop.mp4