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 <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
This commit is contained in:
Duncan
2026-08-07 16:50:01 -04:00
parent d61d8b1178
commit dec35a502f

View File

@@ -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 };
}