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.
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. |
jjcoffee
left a comment
There was a problem hiding this comment.
Just need to DRY up code & add missing screenshots. Thanks! 🙏
|
Done. Please have a look! |
jjcoffee
left a comment
There was a problem hiding this comment.
LGTM! Thanks for the fix!
src/libs/getPlatform/index.ts
Outdated
| import type Platform from './types'; | ||
|
|
||
| export default function getPlatform(): Platform { | ||
| export default function getPlatform(treatMWebDifferently = false): Platform { |
There was a problem hiding this comment.
Would you mind renaming this param to shouldMobileWebBeDistinctFromWeb?
There was a problem hiding this comment.
Done. And I was thinking for a smaller name because treatMWebDifferently was already mouthful.
There was a problem hiding this comment.
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 🚀
|
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.0.59-3 🚀
|
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 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
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