fix useComment

This commit is contained in:
plebbitor
2023-03-25 15:34:10 +01:00
parent baf0ff2465
commit 1d7961de9b
3 changed files with 13 additions and 11 deletions
+6 -2
View File
@@ -44,13 +44,17 @@ const Thread = () => {
const navigate = useNavigate();
const [prevScrollPos, setPrevScrollPos] = useState(0);
const [visible, setVisible] = useState(true);
const comment = useComment({selectedThread});
const comment = useComment({commentCid: selectedThread});
const { subplebbitAddress, threadCid } = useParams();
const handleClickForm = useClickForm();
const commentMediaInfo = getCommentMediaInfo(comment);
const fallbackImgUrl = "/assets/filedeleted-res.gif";
// useEffect(() => {
// console.log(comment);
// }, [comment]);
// temporary title from JSON, gets subplebbitAddress and threadCid from URL
useEffect(() => {
@@ -390,7 +394,7 @@ const Thread = () => {
<hr />
</TopBar>
<BoardForm selectedStyle={selectedStyle}>
{comment ? (
{comment !== undefined ? (
<>
<div className="thread">
<div className="op-container">