diff --git a/lib/shared/threads/protocols/dm-thread-protocol.js b/lib/shared/threads/protocols/dm-thread-protocol.js --- a/lib/shared/threads/protocols/dm-thread-protocol.js +++ b/lib/shared/threads/protocols/dm-thread-protocol.js @@ -930,6 +930,7 @@ description: true, color: true, }, + supportsBackgroundNotifs: true, }); function pendingThreadType(numberOfOtherMembers: number) { diff --git a/lib/shared/threads/protocols/farcaster-thread-protocol.js b/lib/shared/threads/protocols/farcaster-thread-protocol.js --- a/lib/shared/threads/protocols/farcaster-thread-protocol.js +++ b/lib/shared/threads/protocols/farcaster-thread-protocol.js @@ -359,6 +359,7 @@ // Farcaster threads do not support color changes color: false, }, + supportsBackgroundNotifs: false, }; export { farcasterThreadProtocol }; diff --git a/lib/shared/threads/protocols/keyserver-thread-protocol.js b/lib/shared/threads/protocols/keyserver-thread-protocol.js --- a/lib/shared/threads/protocols/keyserver-thread-protocol.js +++ b/lib/shared/threads/protocols/keyserver-thread-protocol.js @@ -687,6 +687,7 @@ description: true, color: true, }, + supportsBackgroundNotifs: true, }); function pendingThreadType(numberOfOtherMembers: number) { diff --git a/lib/shared/threads/thread-spec.js b/lib/shared/threads/thread-spec.js --- a/lib/shared/threads/thread-spec.js +++ b/lib/shared/threads/thread-spec.js @@ -437,6 +437,7 @@ +description: boolean, +color: boolean, }, + +supportsBackgroundNotifs: boolean, }; export type ThreadSpec< diff --git a/native/chat/settings/thread-settings-notifications.react.js b/native/chat/settings/thread-settings-notifications.react.js --- a/native/chat/settings/thread-settings-notifications.react.js +++ b/native/chat/settings/thread-settings-notifications.react.js @@ -7,6 +7,7 @@ threadSettingsNotificationsCopy, useThreadSettingsNotifications, } from 'lib/shared/thread-settings-notifications-utils.js'; +import { threadSpecs } from 'lib/shared/threads/thread-specs.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import EnumSettingsOption from '../../components/enum-settings-option.react.js'; @@ -218,6 +219,30 @@ [notificationSettings], ); + const notifCountOnlySetting = React.useMemo(() => { + if (!threadSpecs[threadInfo.type].protocol().supportsBackgroundNotifs) { + return null; + } + return ( + + + + ); + }, [ + notifCountOnlyDescription, + notifCountOnlyIllustration, + notificationSettings, + onNotifCountOnlySelected, + styles.enumSettingsOptionContainer, + threadInfo.type, + ]); + const threadSettingsNotifications = React.useMemo(() => { return ( @@ -230,15 +255,7 @@ icon={allNotificationsIllustration} /> - - - + {notifCountOnlySetting} { + if (!threadSpecs[threadInfo.type].protocol().supportsBackgroundNotifs) { + return null; + } const icon = ; return ( ); - }, [isNotifyCountOnlySelected, onNotifCountOnlySelected]); + }, [isNotifyCountOnlySelected, onNotifCountOnlySelected, threadInfo]); const isMutedSelected = notificationSettings === 'muted'; const backgroundItem = React.useMemo(() => {