mirror of
https://github.com/block/buzz.git
synced 2026-10-31 22:41:12 +00:00
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:
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user