diff --git a/src/components/post/post.tsx b/src/components/post/post.tsx index fd98d75c..d196811f 100644 --- a/src/components/post/post.tsx +++ b/src/components/post/post.tsx @@ -105,9 +105,9 @@ const Post = ({ post = {}, index }: PostProps) => { const isInPostView = isPostView(location.pathname, params); const isInPendingView = isPendingView(location.pathname, params); const isInSubplebbitView = isSubplebbitView(location.pathname, params); - const isInPostView = isInPostView || isInPendingView; + const isInPostPage = isInPostView || isInPendingView; - const [isExpanded, setIsExpanded] = useState(isInPostView); + const [isExpanded, setIsExpanded] = useState(isInPostPage); const toggleExpanded = () => setIsExpanded(!isExpanded); const [upvoted, upvote] = useUpvote(post); diff --git a/src/components/reply/reply.tsx b/src/components/reply/reply.tsx index 3da4640a..9a81ff70 100644 --- a/src/components/reply/reply.tsx +++ b/src/components/reply/reply.tsx @@ -1,5 +1,5 @@ import { useEffect, useMemo, useState } from 'react'; -import { Comment, useAccountComment, useAuthorAddress, useBlock, useComment, useSubplebbit } from '@plebbit/plebbit-react-hooks'; +import { Comment, useAccountComment, useAuthorAddress, useBlock, useComment, useEditedComment, useSubplebbit } from '@plebbit/plebbit-react-hooks'; import { flattenCommentsPages } from '@plebbit/plebbit-react-hooks/dist/lib/utils'; import { Link, useLocation } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; @@ -187,6 +187,11 @@ interface ReplyProps { } const Reply = ({ depth = 0, isSingle, isNotification = false, reply = {} }: ReplyProps) => { + // handle pending mod or author edit + const { editedComment: editedPost } = useEditedComment({ comment: reply }); + if (editedPost) { + reply = editedPost; + } const { author, cid,