Update post-form.tsx

This commit is contained in:
Tom (plebeius.eth)
2025-01-30 16:32:55 +01:00
parent 2a20716212
commit b1dc7ba486
+22
View File
@@ -148,6 +148,28 @@ const PostFormTable = ({ closeForm, postCid }: { closeForm: () => void; postCid:
}
}, [index, resetPublishPostStore, navigate]);
useEffect(() => {
if (anonMode) {
setPublishPostStore({
signer: undefined,
author: {
address: undefined,
displayName: displayName || undefined,
},
});
getAnonAddressForPost();
} else {
setPublishPostStore({
signer: undefined,
author: {
...account?.author,
displayName: displayName || account?.author?.displayName,
},
});
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [anonMode]);
// in post page, publish a reply to the post
const isInPostView = isPostPageView(location.pathname, params);
const cid = params?.commentCid as string;