MCPcopy Create free account
hub / github.com/CommE2E/comm / useAvatarForThread

Function useAvatarForThread

lib/hooks/avatar-hooks.js:12–18  ·  view source on GitHub ↗
(thread: RawThreadInfo | ThreadInfo)

Source from the content-addressed store, hash-verified

10import { useSelector } from '../utils/redux-utils.js';
11
12function useAvatarForThread(thread: RawThreadInfo | ThreadInfo): ClientAvatar {
13 const { containingThreadID } = thread;
14 const containingThreadInfo = useSelector(state =>
15 containingThreadID ? threadInfoSelector(state)[containingThreadID] : null,
16 );
17 return getAvatarForThread(thread, containingThreadInfo);
18}
19
20export { useAvatarForThread };

Callers 3

ThreadAvatarFunction · 0.90

Calls 2

useSelectorFunction · 0.90
getAvatarForThreadFunction · 0.90

Tested by

no test coverage detected