mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix replymodal in anon mode
This commit is contained in:
@@ -4,13 +4,11 @@ import { StyledModal } from '../styled/modals/ReplyModal.styled';
|
||||
import useGeneralStore from '../../hooks/stores/useGeneralStore';
|
||||
import Modal from 'react-modal';
|
||||
import Draggable from 'react-draggable';
|
||||
import useAnonMode from '../../hooks/useAnonMode';
|
||||
import useError from '../../hooks/useError';
|
||||
|
||||
|
||||
const ReplyModal = ({ isOpen, closeModal }) => {
|
||||
const {
|
||||
anonymousMode,
|
||||
captchaResponse, setCaptchaResponse,
|
||||
setChallengesArray,
|
||||
setIsCaptchaOpen,
|
||||
@@ -21,7 +19,6 @@ const ReplyModal = ({ isOpen, closeModal }) => {
|
||||
selectedParentCid,
|
||||
selectedShortCid,
|
||||
selectedStyle,
|
||||
selectedThread,
|
||||
} = useGeneralStore(state => state);
|
||||
|
||||
const account = useAccount();
|
||||
@@ -36,9 +33,6 @@ const ReplyModal = ({ isOpen, closeModal }) => {
|
||||
const [triggerPublishComment, setTriggerPublishComment] = useState(false);
|
||||
const [selectedText, setSelectedText] = useState('');
|
||||
const [isMobile, setIsMobile] = useState(window.innerWidth <= 480);
|
||||
const [executeAnonMode, setExecuteAnonMode] = useState(false);
|
||||
|
||||
useAnonMode(selectedThread, anonymousMode && executeAnonMode);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
@@ -163,13 +157,6 @@ const ReplyModal = ({ isOpen, closeModal }) => {
|
||||
|
||||
setTriggerPublishComment(true);
|
||||
};
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (anonymousMode) {
|
||||
setExecuteAnonMode(true);
|
||||
}
|
||||
}, [anonymousMode, selectedThread]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -206,7 +206,7 @@ export const StyledModal = styled(Modal)`
|
||||
background-color: currentColor;
|
||||
position: absolute;
|
||||
left: 18px;
|
||||
top: 116px;
|
||||
top: 120px;
|
||||
}
|
||||
|
||||
.anon-tip::after {
|
||||
@@ -217,7 +217,7 @@ export const StyledModal = styled(Modal)`
|
||||
background-color: currentColor;
|
||||
position: absolute;
|
||||
left: 18px;
|
||||
top: 105px;
|
||||
top: 108px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -669,7 +669,6 @@ const All = () => {
|
||||
if (e.button === 2) return;
|
||||
e.preventDefault();
|
||||
setIsReplyOpen(true);
|
||||
setSelectedThread(thread.cid);
|
||||
setSelectedShortCid(thread.shortCid);
|
||||
setSelectedParentCid(thread.cid);
|
||||
setSelectedAddress(thread.subplebbitAddress);
|
||||
@@ -949,7 +948,6 @@ const All = () => {
|
||||
if (e.button === 2) return;
|
||||
e.preventDefault();
|
||||
setIsReplyOpen(true);
|
||||
setSelectedThread(thread.cid);
|
||||
setSelectedShortCid(reply.shortCid);
|
||||
setSelectedParentCid(reply.cid);
|
||||
setSelectedAddress(thread.subplebbitAddress);
|
||||
@@ -1383,7 +1381,6 @@ const All = () => {
|
||||
if (e.button === 2) return;
|
||||
e.preventDefault();
|
||||
setIsReplyOpen(true);
|
||||
setSelectedThread(thread.cid);
|
||||
setSelectedShortCid(thread.shortCid);
|
||||
setSelectedParentCid(thread.cid);
|
||||
setSelectedAddress(thread.subplebbitAddress);
|
||||
@@ -1556,7 +1553,6 @@ const All = () => {
|
||||
if (e.button === 2) return;
|
||||
e.preventDefault();
|
||||
setIsReplyOpen(true);
|
||||
setSelectedThread(thread.cid);
|
||||
setSelectedShortCid(reply.shortCid);
|
||||
setSelectedParentCid(reply.cid);
|
||||
setSelectedAddress(thread.subplebbitAddress);
|
||||
|
||||
@@ -1115,7 +1115,6 @@ const Board = () => {
|
||||
onClick={(e) => {
|
||||
if (e.button === 2) return;
|
||||
e.preventDefault();
|
||||
setSelectedThread(thread.cid);
|
||||
setIsReplyOpen(true);
|
||||
setSelectedShortCid(thread.shortCid);
|
||||
setSelectedParentCid(thread.cid);
|
||||
@@ -1393,7 +1392,6 @@ const Board = () => {
|
||||
onClick={(e) => {
|
||||
if (e.button === 2) return;
|
||||
e.preventDefault();
|
||||
setSelectedThread(thread.cid);
|
||||
setIsReplyOpen(true);
|
||||
setSelectedShortCid(reply.shortCid);
|
||||
setSelectedParentCid(reply.cid);
|
||||
@@ -1798,7 +1796,6 @@ const Board = () => {
|
||||
onClick={(e) => {
|
||||
if (e.button === 2) return;
|
||||
e.preventDefault();
|
||||
setSelectedThread(thread.cid);
|
||||
setIsReplyOpen(true);
|
||||
setSelectedShortCid(thread.shortCid);
|
||||
setSelectedParentCid(thread.cid);
|
||||
@@ -1949,7 +1946,6 @@ const Board = () => {
|
||||
onClick={(e) => {
|
||||
if (e.button === 2) return;
|
||||
e.preventDefault();
|
||||
setSelectedThread(thread.cid);
|
||||
setIsReplyOpen(true);
|
||||
setSelectedShortCid(reply.shortCid);
|
||||
setSelectedParentCid(reply.cid);
|
||||
|
||||
@@ -679,7 +679,6 @@ const Subscriptions = () => {
|
||||
if (e.button === 2) return;
|
||||
e.preventDefault();
|
||||
setIsReplyOpen(true);
|
||||
setSelectedThread(thread.cid);
|
||||
setSelectedShortCid(thread.shortCid);
|
||||
setSelectedParentCid(thread.cid);
|
||||
setSelectedAddress(thread.subplebbitAddress);
|
||||
@@ -959,7 +958,6 @@ const Subscriptions = () => {
|
||||
if (e.button === 2) return;
|
||||
e.preventDefault();
|
||||
setIsReplyOpen(true);
|
||||
setSelectedThread(thread.cid);
|
||||
setSelectedShortCid(reply.shortCid);
|
||||
setSelectedParentCid(reply.cid);
|
||||
setSelectedAddress(thread.subplebbitAddress);
|
||||
@@ -1393,7 +1391,6 @@ const Subscriptions = () => {
|
||||
if (e.button === 2) return;
|
||||
e.preventDefault();
|
||||
setIsReplyOpen(true);
|
||||
setSelectedThread(thread.cid);
|
||||
setSelectedShortCid(thread.shortCid);
|
||||
setSelectedParentCid(thread.cid);
|
||||
setSelectedAddress(thread.subplebbitAddress);
|
||||
@@ -1566,7 +1563,6 @@ const Subscriptions = () => {
|
||||
if (e.button === 2) return;
|
||||
e.preventDefault();
|
||||
setIsReplyOpen(true);
|
||||
setSelectedThread(thread.cid);
|
||||
setSelectedShortCid(reply.shortCid);
|
||||
setSelectedParentCid(reply.cid);
|
||||
setSelectedAddress(thread.subplebbitAddress);
|
||||
|
||||
Reference in New Issue
Block a user