Skip to content

Commit e581532

Browse files
authored
Merge pull request Expensify#68119 from callstack-internal/refactor/remove-connect-muted-platform
[NO QA] Refactor sound connection logic to use connectWithoutView for platfor…
2 parents d0778c3 + 54cb530 commit e581532

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"test:debug": "TZ=utc NODE_OPTIONS='--inspect-brk --experimental-vm-modules' jest --runInBand",
4747
"perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure",
4848
"typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc",
49-
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=262 --cache --cache-location=node_modules/.cache/eslint",
49+
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=261 --cache --cache-location=node_modules/.cache/eslint",
5050
"lint-changed": "NODE_OPTIONS=--max_old_space_size=8192 ./scripts/lintChanged.sh",
5151
"lint-watch": "npx eslint-watch --watch --changed",
5252
"shellcheck": "./scripts/shellCheck.sh",

src/libs/Sound/BaseSound.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ import ONYXKEYS from '@src/ONYXKEYS';
44

55
let isMuted = false;
66

7-
Onyx.connect({
7+
// We use `connectWithoutView` here because this is purely for sound utility logic and not connected
8+
// to any UI component. This connection tracks the platform-specific mute state in a module-level
9+
// variable that sound functions check when called, avoiding unnecessary re-renders since.
10+
Onyx.connectWithoutView({
811
key: ONYXKEYS.NVP_MUTED_PLATFORMS,
912
callback: (val) => {
1013
const platform = getPlatform(true);

0 commit comments

Comments
 (0)