Skip to content

Commit 1b21e94

Browse files
committed
Refactor sound connection logic to use connectWithoutView for platform-specific mute state tracking
1 parent b863e23 commit 1b21e94

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

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)