From dec35a502fc162f439d9379bac1069b956b819f4 Mon Sep 17 00:00:00 2001 From: Duncan Date: Fri, 7 Aug 2026 16:50:01 -0400 Subject: [PATCH] chore(readState): remove dead clearChannelUnreadSource from useForcedUnreadActions useForcedUnreadActions.clearChannelUnreadSource was the pre-#3966 local- only source-removal path. It was superseded by useClearChannelUnreadSource in readStateOverride.ts, which routes last-source removals through applyOverrideRead so the NIP-RS register receives its C-bump cross-device. useUnreadChannels.ts already destructures only markChannelUnread from useForcedUnreadActions; the clearChannelUnreadSource return value has been dead since the branch introduced useClearChannelUnreadSource. Remove the dead callback and the return slot (plan standing MINOR). Co-authored-by: Will Pfleger Signed-off-by: Will Pfleger --- desktop/src/features/channels/forcedUnreadStore.ts | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/desktop/src/features/channels/forcedUnreadStore.ts b/desktop/src/features/channels/forcedUnreadStore.ts index 4d22eeabf2..6855f7ff9a 100644 --- a/desktop/src/features/channels/forcedUnreadStore.ts +++ b/desktop/src/features/channels/forcedUnreadStore.ts @@ -157,17 +157,5 @@ export function useForcedUnreadActions( }, [forcedUnreadRef, getOwnTimestamp, persist], ); - const clearChannelUnreadSource = React.useCallback( - (channelId: string, source: ForcedUnreadSource) => { - if (!Object.hasOwn(forcedUnreadRef.current, channelId)) return; - const current = forcedUnreadRef.current[channelId]; - const next = removeForcedUnreadSource(current, source); - if (next === current) return; - if (next === undefined) delete forcedUnreadRef.current[channelId]; - else forcedUnreadRef.current[channelId] = next; - persist(); - }, - [forcedUnreadRef, persist], - ); - return { clearChannelUnreadSource, markChannelUnread }; + return { markChannelUnread }; }