mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix replying to reply requires postCid in new API
This commit is contained in:
@@ -31,7 +31,11 @@ interface ReplyModalProps {
|
|||||||
|
|
||||||
const ReplyModal = ({ closeModal, showReplyModal, parentCid, postCid, scrollY, subplebbitAddress }: ReplyModalProps) => {
|
const ReplyModal = ({ closeModal, showReplyModal, parentCid, postCid, scrollY, subplebbitAddress }: ReplyModalProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { setPublishReplyOptions, publishReply, resetPublishReplyOptions, replyIndex } = usePublishReply({ cid: parentCid, subplebbitAddress });
|
const { setPublishReplyOptions, publishReply, resetPublishReplyOptions, replyIndex } = usePublishReply({
|
||||||
|
cid: parentCid,
|
||||||
|
subplebbitAddress,
|
||||||
|
postCid,
|
||||||
|
});
|
||||||
const account = useAccount();
|
const account = useAccount();
|
||||||
const { displayName } = account?.author || {};
|
const { displayName } = account?.author || {};
|
||||||
const [url, setUrl] = useState('');
|
const [url, setUrl] = useState('');
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Comment, useAccount, usePublishComment } from '@plebbit/plebbit-react-h
|
|||||||
import useAnonMode from './use-anon-mode';
|
import useAnonMode from './use-anon-mode';
|
||||||
import usePublishReplyStore from '../stores/use-publish-reply-store';
|
import usePublishReplyStore from '../stores/use-publish-reply-store';
|
||||||
|
|
||||||
const usePublishReply = ({ cid, subplebbitAddress }: { cid: string; subplebbitAddress: string }) => {
|
const usePublishReply = ({ cid, subplebbitAddress, postCid }: { cid: string; subplebbitAddress: string; postCid?: string }) => {
|
||||||
const parentCid = cid;
|
const parentCid = cid;
|
||||||
const account = useAccount();
|
const account = useAccount();
|
||||||
const { anonMode } = useAnonMode();
|
const { anonMode } = useAnonMode();
|
||||||
@@ -26,6 +26,7 @@ const usePublishReply = ({ cid, subplebbitAddress }: { cid: string; subplebbitAd
|
|||||||
const newOptions: Comment = {
|
const newOptions: Comment = {
|
||||||
subplebbitAddress,
|
subplebbitAddress,
|
||||||
parentCid,
|
parentCid,
|
||||||
|
postCid: postCid ?? parentCid,
|
||||||
content: options.content === '' ? undefined : options.content ?? content,
|
content: options.content === '' ? undefined : options.content ?? content,
|
||||||
link: options.link === '' ? undefined : options.link ?? link,
|
link: options.link === '' ? undefined : options.link ?? link,
|
||||||
spoiler: options.spoiler ?? spoiler,
|
spoiler: options.spoiler ?? spoiler,
|
||||||
|
|||||||
Reference in New Issue
Block a user