removed navigate and toast from replymodal

This commit is contained in:
plebbitor
2023-04-23 12:21:41 +02:00
parent 9010510aa9
commit 946efbdb69
3 changed files with 3 additions and 15 deletions
+1 -13
View File
@@ -1,5 +1,4 @@
import React, { useRef, useState, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import { usePublishComment } from '@plebbit/plebbit-react-hooks';
import { StyledModal } from './styled/ReplyModal.styled';
import useGeneralStore from '../hooks/stores/useGeneralStore';
@@ -19,11 +18,8 @@ const ReplyModal = ({ isOpen, closeModal }) => {
selectedParentCid,
selectedShortCid,
selectedStyle,
selectedThread,
} = useGeneralStore(state => state);
const navigate = useNavigate();
const nodeRef = useRef(null);
const nameRef = useRef();
@@ -70,15 +66,7 @@ const ReplyModal = ({ isOpen, closeModal }) => {
});
const { publishComment, index } = usePublishComment(publishCommentOptions);
useEffect(() => {
if (index !== undefined) {
navigate(`/p/${selectedAddress}/c/${selectedParentCid}`)
localStorage.setItem("toastMessage", `Comment pending with index ${index}.`);
}
}, [index]);
const { publishComment } = usePublishComment(publishCommentOptions);
const resetFields = () => {