From e4a3c0504e01a0d4df6c1fe3b57807eb96344e41 Mon Sep 17 00:00:00 2001 From: plebeius Date: Tue, 23 Dec 2025 19:33:46 +0100 Subject: [PATCH] prevent type error --- src/components/post-desktop/post-desktop.tsx | 2 +- src/components/post-mobile/post-mobile.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index 4efd8b55..77b68154 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -57,7 +57,7 @@ const PostInfo = ({ post, postReplyCount = 0, roles, isHidden }: PostProps) => { const replies = useReplies(post); const { address, shortAddress } = author || {}; const displayName = author?.displayName?.trim(); - const authorRole = roles?.[address]?.role.replace('moderator', 'mod'); + const authorRole = roles?.[address]?.role?.replace('moderator', 'mod'); const stateString = useStateString(post); const isReply = parentCid; const { showOmittedReplies } = useShowOmittedReplies(); diff --git a/src/components/post-mobile/post-mobile.tsx b/src/components/post-mobile/post-mobile.tsx index 231b0117..de1122cf 100644 --- a/src/components/post-mobile/post-mobile.tsx +++ b/src/components/post-mobile/post-mobile.tsx @@ -56,7 +56,7 @@ const PostInfoAndMedia = ({ post, postReplyCount = 0, roles }: PostProps) => { const title = post?.title?.trim(); const { address, shortAddress } = author || {}; const displayName = author?.displayName?.trim(); - const authorRole = roles?.[address]?.role.replace('moderator', 'mod'); + const authorRole = roles?.[address]?.role?.replace('moderator', 'mod'); const { imageUrl: avatarImageUrl } = useAuthorAvatar({ author }); const { hideAvatars } = useAvatarVisibilityStore();