From 5bbb5f580676c86dabcd8bd2e56d0f99ecb86a7b Mon Sep 17 00:00:00 2001 From: Hailey Date: Mon, 20 May 2024 20:08:29 -0700 Subject: [PATCH] use same visuals for notification sounds setting as the allow messages from (#4141) --- src/screens/Messages/Settings.tsx | 56 ++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 15 deletions(-) diff --git a/src/screens/Messages/Settings.tsx b/src/screens/Messages/Settings.tsx index a9df2456..a27c961f 100644 --- a/src/screens/Messages/Settings.tsx +++ b/src/screens/Messages/Settings.tsx @@ -35,7 +35,7 @@ export function MessagesSettingsScreen({}: Props) { }, }) - const onSelectItem = useCallback( + const onSelectMessagesFrom = useCallback( (keys: string[]) => { const key = keys[0] if (!key) return @@ -44,6 +44,15 @@ export function MessagesSettingsScreen({}: Props) { [updateDeclaration], ) + const onSelectSoundSetting = useCallback( + (keys: string[]) => { + const key = keys[0] + if (!key) return + setPref('playSoundChat', key === 'enabled') + }, + [setPref], + ) + return ( @@ -58,7 +67,7 @@ export function MessagesSettingsScreen({}: Props) { (profile?.associated?.chat?.allowIncoming as AllowIncoming) ?? 'following', ]} - onChange={onSelectItem}> + onChange={onSelectMessagesFrom}> {isNative && ( <> - - { - setPref('playSoundChat', !preferences.playSoundChat) - }}> - - - Play notification sounds - - + + + Notification Sounds + + + + + + Enabled + + + + + + Disabled + + + + + )}