mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix author delete edit
This commit is contained in:
@@ -337,8 +337,8 @@ const All = () => {
|
|||||||
const { publishCommentEdit } = usePublishCommentEdit(publishCommentEditOptions);
|
const { publishCommentEdit } = usePublishCommentEdit(publishCommentEditOptions);
|
||||||
|
|
||||||
|
|
||||||
const handleAuthorDeleteClick = (comment) => {
|
const handleAuthorDeleteClick = (cid) => {
|
||||||
handleOptionClick(comment.cid);
|
handleOptionClick(cid);
|
||||||
|
|
||||||
confirmAlert({
|
confirmAlert({
|
||||||
customUI: ({ onClose }) => {
|
customUI: ({ onClose }) => {
|
||||||
@@ -352,7 +352,7 @@ const All = () => {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsAuthorDelete(true);
|
setIsAuthorDelete(true);
|
||||||
setIsAuthorEdit(false);
|
setIsAuthorEdit(false);
|
||||||
setCommentCid(comment.cid);
|
setCommentCid(cid);
|
||||||
setPublishCommentEditOptions(prevOptions => ({
|
setPublishCommentEditOptions(prevOptions => ({
|
||||||
...prevOptions,
|
...prevOptions,
|
||||||
deleted: true,
|
deleted: true,
|
||||||
@@ -746,7 +746,7 @@ const All = () => {
|
|||||||
{thread.author.shortAddress === account?.author.shortAddress ? (
|
{thread.author.shortAddress === account?.author.shortAddress ? (
|
||||||
<>
|
<>
|
||||||
<li onClick={() => {handleAuthorEditClick(thread); setSelectedAddress(thread.subplebbitAddress);}}>Edit post</li>
|
<li onClick={() => {handleAuthorEditClick(thread); setSelectedAddress(thread.subplebbitAddress);}}>Edit post</li>
|
||||||
<li onClick={() => {handleAuthorDeleteClick(thread); setSelectedAddress(thread.subplebbitAddress);}}>Delete post</li>
|
<li onClick={() => {handleAuthorDeleteClick(thread.cid); setSelectedAddress(thread.subplebbitAddress);}}>Delete post</li>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
{isModerator ? (
|
{isModerator ? (
|
||||||
@@ -1026,7 +1026,7 @@ const All = () => {
|
|||||||
{reply.author.shortAddress === account?.author.shortAddress ? (
|
{reply.author.shortAddress === account?.author.shortAddress ? (
|
||||||
<>
|
<>
|
||||||
<li onClick={() => {handleAuthorEditClick(reply); setSelectedAddress(thread.subplebbitAddress);}}>Edit post</li>
|
<li onClick={() => {handleAuthorEditClick(reply); setSelectedAddress(thread.subplebbitAddress);}}>Edit post</li>
|
||||||
<li onClick={() => {handleAuthorDeleteClick(reply); setSelectedAddress(thread.subplebbitAddress);}}>Delete post</li>
|
<li onClick={() => {handleAuthorDeleteClick(reply.cid); setSelectedAddress(thread.subplebbitAddress);}}>Delete post</li>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
{isModerator ? (
|
{isModerator ? (
|
||||||
|
|||||||
@@ -434,8 +434,8 @@ const Board = () => {
|
|||||||
const { publishCommentEdit } = usePublishCommentEdit(publishCommentEditOptions);
|
const { publishCommentEdit } = usePublishCommentEdit(publishCommentEditOptions);
|
||||||
|
|
||||||
|
|
||||||
const handleAuthorDeleteClick = (comment) => {
|
const handleAuthorDeleteClick = (cid) => {
|
||||||
handleOptionClick(comment.cid);
|
handleOptionClick(cid);
|
||||||
|
|
||||||
confirmAlert({
|
confirmAlert({
|
||||||
customUI: ({ onClose }) => {
|
customUI: ({ onClose }) => {
|
||||||
@@ -449,7 +449,7 @@ const Board = () => {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsAuthorDelete(true);
|
setIsAuthorDelete(true);
|
||||||
setIsAuthorEdit(false);
|
setIsAuthorEdit(false);
|
||||||
setCommentCid(comment.cid);
|
setCommentCid(cid);
|
||||||
setPublishCommentEditOptions(prevOptions => ({
|
setPublishCommentEditOptions(prevOptions => ({
|
||||||
...prevOptions,
|
...prevOptions,
|
||||||
deleted: true,
|
deleted: true,
|
||||||
@@ -1192,7 +1192,7 @@ const Board = () => {
|
|||||||
{thread.author.shortAddress === account?.author.shortAddress ? (
|
{thread.author.shortAddress === account?.author.shortAddress ? (
|
||||||
<>
|
<>
|
||||||
<li onClick={() => handleAuthorEditClick(thread)}>Edit post</li>
|
<li onClick={() => handleAuthorEditClick(thread)}>Edit post</li>
|
||||||
<li onClick={() => handleAuthorDeleteClick(thread)}>Delete post</li>
|
<li onClick={() => handleAuthorDeleteClick(thread.cid)}>Delete post</li>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
{isModerator ? (
|
{isModerator ? (
|
||||||
@@ -1453,7 +1453,7 @@ const Board = () => {
|
|||||||
{reply.author.shortAddress === account?.author.shortAddress ? (
|
{reply.author.shortAddress === account?.author.shortAddress ? (
|
||||||
<>
|
<>
|
||||||
<li onClick={() => handleAuthorEditClick(reply)}>Edit post</li>
|
<li onClick={() => handleAuthorEditClick(reply)}>Edit post</li>
|
||||||
<li onClick={() => handleAuthorDeleteClick(reply)}>Delete post</li>
|
<li onClick={() => handleAuthorDeleteClick(reply.cid)}>Delete post</li>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
{isModerator ? (
|
{isModerator ? (
|
||||||
|
|||||||
@@ -338,8 +338,8 @@ const Subscriptions = () => {
|
|||||||
const { publishCommentEdit } = usePublishCommentEdit(publishCommentEditOptions);
|
const { publishCommentEdit } = usePublishCommentEdit(publishCommentEditOptions);
|
||||||
|
|
||||||
|
|
||||||
const handleAuthorDeleteClick = (comment) => {
|
const handleAuthorDeleteClick = (cid) => {
|
||||||
handleOptionClick(comment.cid);
|
handleOptionClick(cid);
|
||||||
|
|
||||||
confirmAlert({
|
confirmAlert({
|
||||||
customUI: ({ onClose }) => {
|
customUI: ({ onClose }) => {
|
||||||
@@ -353,7 +353,7 @@ const Subscriptions = () => {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsAuthorDelete(true);
|
setIsAuthorDelete(true);
|
||||||
setIsAuthorEdit(false);
|
setIsAuthorEdit(false);
|
||||||
setCommentCid(comment.cid);
|
setCommentCid(cid);
|
||||||
setPublishCommentEditOptions(prevOptions => ({
|
setPublishCommentEditOptions(prevOptions => ({
|
||||||
...prevOptions,
|
...prevOptions,
|
||||||
deleted: true,
|
deleted: true,
|
||||||
@@ -756,7 +756,7 @@ const Subscriptions = () => {
|
|||||||
{thread.author.shortAddress === account?.author.shortAddress ? (
|
{thread.author.shortAddress === account?.author.shortAddress ? (
|
||||||
<>
|
<>
|
||||||
<li onClick={() => {handleAuthorEditClick(thread); setSelectedAddress(thread.subplebbitAddress);}}>Edit post</li>
|
<li onClick={() => {handleAuthorEditClick(thread); setSelectedAddress(thread.subplebbitAddress);}}>Edit post</li>
|
||||||
<li onClick={() => {handleAuthorDeleteClick(thread); setSelectedAddress(thread.subplebbitAddress);}}>Delete post</li>
|
<li onClick={() => {handleAuthorDeleteClick(thread.cid); setSelectedAddress(thread.subplebbitAddress);}}>Delete post</li>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
{isModerator ? (
|
{isModerator ? (
|
||||||
@@ -1036,7 +1036,7 @@ const Subscriptions = () => {
|
|||||||
{reply.author.shortAddress === account?.author.shortAddress ? (
|
{reply.author.shortAddress === account?.author.shortAddress ? (
|
||||||
<>
|
<>
|
||||||
<li onClick={() => {handleAuthorEditClick(reply); setSelectedAddress(thread.subplebbitAddress);}}>Edit post</li>
|
<li onClick={() => {handleAuthorEditClick(reply); setSelectedAddress(thread.subplebbitAddress);}}>Edit post</li>
|
||||||
<li onClick={() => {handleAuthorDeleteClick(reply); setSelectedAddress(thread.subplebbitAddress);}}>Delete post</li>
|
<li onClick={() => {handleAuthorDeleteClick(reply.cid); setSelectedAddress(thread.subplebbitAddress);}}>Delete post</li>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
{isModerator ? (
|
{isModerator ? (
|
||||||
|
|||||||
@@ -401,8 +401,8 @@ const Thread = () => {
|
|||||||
const { publishCommentEdit } = usePublishCommentEdit(publishCommentEditOptions);
|
const { publishCommentEdit } = usePublishCommentEdit(publishCommentEditOptions);
|
||||||
|
|
||||||
|
|
||||||
const handleAuthorDeleteClick = (comment) => {
|
const handleAuthorDeleteClick = (cid) => {
|
||||||
handleOptionClick(comment.cid);
|
handleOptionClick(cid);
|
||||||
|
|
||||||
confirmAlert({
|
confirmAlert({
|
||||||
customUI: ({ onClose }) => {
|
customUI: ({ onClose }) => {
|
||||||
@@ -416,7 +416,7 @@ const Thread = () => {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsAuthorDelete(true);
|
setIsAuthorDelete(true);
|
||||||
setIsAuthorEdit(false);
|
setIsAuthorEdit(false);
|
||||||
setCommentCid(comment.cid);
|
setCommentCid(cid);
|
||||||
setPublishCommentEditOptions(prevOptions => ({
|
setPublishCommentEditOptions(prevOptions => ({
|
||||||
...prevOptions,
|
...prevOptions,
|
||||||
deleted: true,
|
deleted: true,
|
||||||
@@ -879,7 +879,7 @@ const Thread = () => {
|
|||||||
{comment.author?.shortAddress === account?.author.shortAddress ? (
|
{comment.author?.shortAddress === account?.author.shortAddress ? (
|
||||||
<>
|
<>
|
||||||
<li onClick={() => handleAuthorEditClick(comment)}>Edit post</li>
|
<li onClick={() => handleAuthorEditClick(comment)}>Edit post</li>
|
||||||
<li onClick={() => handleAuthorDeleteClick(comment)}>Delete post</li>
|
<li onClick={() => handleAuthorDeleteClick(comment.cid)}>Delete post</li>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
{isModerator ? (
|
{isModerator ? (
|
||||||
@@ -1102,7 +1102,7 @@ const Thread = () => {
|
|||||||
{reply.author.shortAddress === account?.author.shortAddress ? (
|
{reply.author.shortAddress === account?.author.shortAddress ? (
|
||||||
<>
|
<>
|
||||||
<li onClick={() => handleAuthorEditClick(reply)}>Edit post</li>
|
<li onClick={() => handleAuthorEditClick(reply)}>Edit post</li>
|
||||||
<li onClick={() => handleAuthorDeleteClick(reply)}>Delete post</li>
|
<li onClick={() => handleAuthorDeleteClick(reply.cid)}>Delete post</li>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
{isModerator ? (
|
{isModerator ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user