From 71b6418dfad8a02b15c9dc92fc7fb35625a990d4 Mon Sep 17 00:00:00 2001 From: codytseng Date: Wed, 30 Jul 2025 11:17:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PostEditor/PostContent.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/PostEditor/PostContent.tsx b/src/components/PostEditor/PostContent.tsx index da53fa8a..e06e3737 100644 --- a/src/components/PostEditor/PostContent.tsx +++ b/src/components/PostEditor/PostContent.tsx @@ -8,6 +8,7 @@ import { } from '@/lib/draft-event' import { isTouchDevice } from '@/lib/utils' import { useNostr } from '@/providers/NostrProvider' +import { useReply } from '@/providers/ReplyProvider' import postEditorCache from '@/services/post-editor-cache.service' import { TPollCreateData } from '@/types' import { ImageUp, ListTodo, LoaderCircle, Settings, Smile } from 'lucide-react' @@ -35,6 +36,7 @@ export default function PostContent({ }) { const { t } = useTranslation() const { pubkey, publish, checkLogin } = useNostr() + const { addReplies } = useReply() const { uploadingFiles, setUploadingFiles } = usePostEditor() const [text, setText] = useState('') const textareaRef = useRef(null) @@ -128,10 +130,11 @@ export default function PostContent({ isNsfw }) - await publish(draftEvent, { + const newEvent = await publish(draftEvent, { specifiedRelayUrls, additionalRelayUrls: isPoll ? pollCreateData.relays : [] }) + addReplies([newEvent]) postEditorCache.clearPostCache({ defaultContent, parentEvent }) close() } catch (error) {