diff --git a/src/components/post-form/post-form.tsx b/src/components/post-form/post-form.tsx index 2227f388..1f298758 100644 --- a/src/components/post-form/post-form.tsx +++ b/src/components/post-form/post-form.tsx @@ -248,6 +248,18 @@ const PostFormTable = ({ closeForm, postCid }: { closeForm: () => void; postCid: } }; + const hasInitializedDisplayName = useRef(false); + useEffect(() => { + if (displayName && !hasInitializedDisplayName.current) { + hasInitializedDisplayName.current = true; + if (isInPostView) { + setPublishReplyOptions({ displayName }); + } else { + setPublishPostStore({ displayName }); + } + } + }, [displayName, isInPostView]); + return ( diff --git a/src/components/reply-modal/reply-modal.tsx b/src/components/reply-modal/reply-modal.tsx index 58768337..41d690c2 100644 --- a/src/components/reply-modal/reply-modal.tsx +++ b/src/components/reply-modal/reply-modal.tsx @@ -222,6 +222,14 @@ const ReplyModal = ({ closeModal, showReplyModal, parentCid, postCid, scrollY, s } }; + const hasInitializedDisplayName = useRef(false); + useEffect(() => { + if (displayName && !hasInitializedDisplayName.current) { + hasInitializedDisplayName.current = true; + setPublishReplyOptions({ displayName }); + } + }, [displayName]); + const modalContent = (