fix error messages, comment edits, ENS discrepancy

This commit is contained in:
plebeius.eth
2023-07-02 21:36:08 +02:00
parent e2a9556305
commit 42bafa6abd
9 changed files with 103 additions and 55 deletions
+16 -10
View File
@@ -288,7 +288,8 @@ const Subscriptions = () => {
setNewSuccessMessage('Challenge Success');
}
else if (challengeVerification.challengeSuccess === false) {
setNewErrorMessage('Challenge Failed', {reason: challengeVerification.reason, errors: challengeVerification.errors});
setNewErrorMessage(`Challenge Failed, reason: ${challengeVerification.reason}. Errors: ${challengeVerification.errors}`);
console.log('challenge failed', challengeVerification);
}
};
@@ -364,8 +365,8 @@ const Subscriptions = () => {
const { publishCommentEdit } = usePublishCommentEdit(publishCommentEditOptions);
const handleAuthorDeleteClick = (cid) => {
handleOptionClick(cid);
const handleAuthorDeleteClick = (comment) => {
handleOptionClick(comment.cid);
confirmAlert({
customUI: ({ onClose }) => {
@@ -379,9 +380,10 @@ const Subscriptions = () => {
onClick={() => {
setIsAuthorDelete(true);
setIsAuthorEdit(false);
setCommentCid(cid);
setPublishCommentEditOptions(prevOptions => ({
...prevOptions,
commentCid: comment.cid,
subplebbitAddress: comment.subplebbitAddress,
deleted: true,
}));
setTriggerPublishCommentEdit(true);
@@ -786,15 +788,17 @@ const Subscriptions = () => {
>
<ul className="post-menu-catalog">
<li onClick={() => handleOptionClick(thread.cid)}>Hide thread</li>
{thread.author.shortAddress === account?.author.shortAddress ? (
{thread.author.address === account?.author.address ||
thread.author.address === account?.signer.address ? (
<>
<li onClick={() => {handleAuthorEditClick(thread); setSelectedAddress(thread.subplebbitAddress);}}>Edit post</li>
<li onClick={() => {handleAuthorDeleteClick(thread.cid); setSelectedAddress(thread.subplebbitAddress);}}>Delete post</li>
<li onClick={() => {handleAuthorDeleteClick(thread); setSelectedAddress(thread.subplebbitAddress);}}>Delete post</li>
</>
) : null}
{isModerator ? (
<>
{thread.author.shortAddress === account?.author.shortAddress ? (
{thread.author.address === account?.author.address ||
thread.author.address === account?.signer.address ? (
null
) : (
<li onClick={() => {
@@ -1074,15 +1078,17 @@ const Subscriptions = () => {
>
<ul className="post-menu-catalog">
<li onClick={() => handleOptionClick(reply.cid)}>Hide post</li>
{reply.author.shortAddress === account?.author.shortAddress ? (
{reply.author.address === account?.author.address ||
reply.author.address === account?.signer.address ? (
<>
<li onClick={() => {handleAuthorEditClick(reply); setSelectedAddress(thread.subplebbitAddress);}}>Edit post</li>
<li onClick={() => {handleAuthorDeleteClick(reply.cid); setSelectedAddress(thread.subplebbitAddress);}}>Delete post</li>
<li onClick={() => {handleAuthorDeleteClick(reply); setSelectedAddress(thread.subplebbitAddress);}}>Delete post</li>
</>
) : null}
{isModerator ? (
<>
{reply.author.shortAddress === account?.author.shortAddress ? (
{reply.author.address === account?.author.address ||
reply.author.address === account?.signer.address ? (
null
) : (
<li onClick={() => {