nicolium: fix nonsense memoization

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2026-03-01 21:49:13 +01:00
parent 8bec9bb746
commit b5ef881a18

View File

@ -291,23 +291,11 @@ const useThread = (statusId?: string, linear?: boolean) => {
}, [inReplyTos, replies, statusId, linear]);
};
const useReplyToId = (statusId?: string) => {
const inReplyTos = useContextStore((state) => state.inReplyTos);
const useReplyToId = (statusId?: string) =>
useContextStore((state) => (statusId ? state.inReplyTos[statusId] : undefined));
return useMemo(() => {
if (!statusId) return undefined;
return inReplyTos[statusId];
}, [inReplyTos, statusId]);
};
const useReplyCount = (statusId?: string) => {
const replies = useContextStore((state) => state.replies);
return useMemo(() => {
if (!statusId) return 0;
return replies[statusId]?.length || 0;
}, [replies, statusId]);
};
const useReplyCount = (statusId?: string) =>
useContextStore((state) => (statusId ? (state.replies[statusId]?.length ?? 0) : 0));
const useContextsActions = () => useContextStore((state) => state.actions);