diff --git a/src/components/views/All.jsx b/src/components/views/All.jsx index 1d137029..dcd03dda 100755 --- a/src/components/views/All.jsx +++ b/src/components/views/All.jsx @@ -717,7 +717,7 @@ const All = () => { const { displayedReplies, omittedCount } = filteredRepliesByThread[thread.cid] || {}; const commentMediaInfo = getCommentMediaInfo(thread); const fallbackImgUrl = 'assets/filedeleted-res.gif'; - const isModerator = moderatorPermissions[thread.subplebbitAddress]; + const canModerate = moderatorPermissions[thread.subplebbitAddress]; let displayWidth, displayHeight, displayWidthMobile, displayHeightMobile; if (thread.linkWidth && thread.linkHeight) { let scale = Math.min(1, 250 / Math.max(thread.linkWidth, thread.linkHeight)); @@ -1037,7 +1037,7 @@ const All = () => {
  • handleAuthorDeleteClick(thread)}>Delete post
  • ) : null} - {isModerator ? ( + {canModerate ? ( <> {authorAddress === account?.author.address || authorAddress === account?.signer.address ? null : (
  • {
  • handleAuthorDeleteClick(reply)}>Delete post
  • ) : null} - {isModerator ? ( + {canModerate ? ( <> {authorAddress === account?.author.address || authorAddress === account?.signer.address ? null : (
  • {
  • handleAuthorDeleteClick(thread)}>Delete post
  • ) : null} - {isModerator ? ( + {canModerate ? ( <> {authorAddress === account?.author.address || authorAddress === account?.signer.address ? null : (
  • {
  • handleAuthorDeleteClick(reply)}>Delete post
  • ) : null} - {isModerator ? ( + {canModerate ? ( <> {authorAddress === account?.author.address || authorAddress === account?.signer.address ? null : (
  • { 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 }) => {
  • handleAuthorDeleteClick(thread)}>Delete post
  • ) : null} - {isModerator ? ( + {canModerate ? ( <> {authorAddress === account?.author.address || authorAddress === account?.signer.address ? null : (
  • { const [deletePost, setDeletePost] = useState(false); const [isImageSearchOpen, setIsImageSearchOpen] = useState(false); const [isClientRedirectMenuOpen, setIsClientRedirectMenuOpen] = useState(false); - const [isModerator, setIsModerator] = useState(false); + const [canModerate, setCanModerate] = useState(false); const [commentCid, setCommentCid] = useState(null); const [menuPosition, setMenuPosition] = useState({ top: 0, left: 0 }); const [mobileMenuPosition, setMobileMenuPosition] = useState({ top: 0, left: 0 }); @@ -180,9 +180,9 @@ const Board = () => { 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]); @@ -1039,7 +1039,7 @@ const Board = () => { >