refactor(state): rename isModerator to canModerate for precision

This commit is contained in:
plebeius.eth
2023-09-28 21:05:03 +02:00
parent bce924e90f
commit b6cdc00843
10 changed files with 58 additions and 58 deletions
@@ -69,7 +69,7 @@ const CatalogPost = ({ post }) => {
const [isImageSearchOpen, setIsImageSearchOpen] = useState(false);
const [isClientRedirectMenuOpen, setIsClientRedirectMenuOpen] = useState(false);
const [commentCid, setCommentCid] = useState(null);
const [isModerator, setIsModerator] = useState(false);
const [canModerate, setCanModerate] = useState(false);
const [, setNewErrorMessage] = useError();
const [, setNewSuccessMessage] = useSuccess();
@@ -161,9 +161,9 @@ const CatalogPost = ({ post }) => {
const role = subplebbit.roles[account?.author.address]?.role;
if (role === 'moderator' || role === 'admin' || role === 'owner') {
setIsModerator(true);
setCanModerate(true);
} else {
setIsModerator(false);
setCanModerate(false);
}
}
}, [account?.author.address, subplebbit.roles]);
@@ -573,7 +573,7 @@ const CatalogPost = ({ post }) => {
<li onClick={() => handleAuthorDeleteClick(thread)}>Delete post</li>
</>
) : null}
{isModerator ? (
{canModerate ? (
<>
{authorAddress === account?.author.address || authorAddress === account?.signer.address ? null : (
<li