fix(edit menu): couldn't edit post content if post was just published

This commit is contained in:
Tom (plebeius.eth)
2024-08-29 15:00:21 +02:00
parent d482d32467
commit 9543f16f68
+8 -1
View File
@@ -1,4 +1,4 @@
import { useState } from 'react';
import { useEffect, useState } from 'react';
import { Trans, useTranslation } from 'react-i18next';
import { autoUpdate, FloatingFocusManager, offset, shift, useClick, useDismiss, useFloating, useId, useInteractions, useRole } from '@floating-ui/react';
import { Comment, PublishCommentEditOptions, usePublishCommentEdit } from '@plebbit/plebbit-react-hooks';
@@ -101,6 +101,13 @@ const EditMenu = ({ isAccountMod, isAccountCommentAuthor, isCommentAuthorMod, po
const headingId = useId();
useEffect(() => {
setPublishCommentEditOptions((prevOptions) => ({
...prevOptions,
commentCid: cid,
}));
}, [cid]);
const _publishCommentEdit = async () => {
try {
await publishCommentEdit();