Page MenuHomePhabricator

D13745.id45253.diff
No OneTemporary

D13745.id45253.diff

diff --git a/web/avatars/thread-avatar.react.js b/web/avatars/thread-avatar.react.js
--- a/web/avatars/thread-avatar.react.js
+++ b/web/avatars/thread-avatar.react.js
@@ -4,8 +4,9 @@
import { useAvatarForThread } from 'lib/hooks/avatar-hooks.js';
import { useResolvedThreadAvatar } from 'lib/shared/avatar-utils.js';
-import { getSingleOtherUser } from 'lib/shared/thread-utils.js';
+import { getSingleOtherUser, getCommunity } from 'lib/shared/thread-utils.js';
import type { AvatarSize } from 'lib/types/avatar-types.js';
+import type { CommunityInfo } from 'lib/types/community-types.js';
import type {
ThreadInfo,
RawThreadInfo,
@@ -33,6 +34,14 @@
state => state.currentUserInfo && state.currentUserInfo.id,
);
+ const communityID = getCommunity(threadInfo);
+ const communityInfo: ?CommunityInfo = useSelector(state => {
+ if (!communityID) {
+ return null;
+ }
+ return state.communityStore.communityInfos[communityID];
+ });
+
let displayUserIDForThread;
if (threadTypeIsPrivate(threadInfo.type)) {
displayUserIDForThread = viewerID;
@@ -55,7 +64,17 @@
};
});
- const resolvedThreadAvatar = useResolvedThreadAvatar(avatarInfo, displayUser);
+ let userOrChannel;
+ if (displayUserIDForThread) {
+ userOrChannel = displayUser;
+ } else if (communityInfo?.farcasterChannelID) {
+ userOrChannel = { fcChannelID: communityInfo.farcasterChannelID };
+ }
+
+ const resolvedThreadAvatar = useResolvedThreadAvatar(
+ avatarInfo,
+ userOrChannel,
+ );
return (
<Avatar

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 1:14 AM (18 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2566978
Default Alt Text
D13745.id45253.diff (1 KB)

Event Timeline