refactor(core): remove legacy plebbit terminology

This commit is contained in:
Tommaso Casaburi
2026-04-17 10:48:27 +07:00
parent e366dac25c
commit ee7a5b5778
158 changed files with 626 additions and 836 deletions
+2 -4
View File
@@ -4,17 +4,15 @@ import { useCommunityField } from './use-stable-community';
interface AuthorPrivilegesProps {
commentAuthorAddress: string;
subplebbitAddress?: string;
communityAddress?: string;
postCid?: string;
}
const useAuthorPrivileges = ({ commentAuthorAddress, subplebbitAddress, communityAddress }: AuthorPrivilegesProps) => {
const useAuthorPrivileges = ({ commentAuthorAddress, communityAddress }: AuthorPrivilegesProps) => {
const account = useAccount();
const targetAddress = communityAddress ?? subplebbitAddress;
const accountAuthorAddress = account?.author?.address;
// Only subscribe to roles field to avoid rerenders from updatingState changes
const roles = useCommunityField(targetAddress, (community) => community?.roles);
const roles = useCommunityField(communityAddress, (community) => community?.roles);
const { isCommentAuthorMod, isAccountMod, isAccountCommentAuthor, commentAuthorRole, accountAuthorRole } = useMemo(() => {
const commentAuthorRole = roles?.[commentAuthorAddress]?.role;
const isCommentAuthorMod = commentAuthorRole === 'admin' || commentAuthorRole === 'owner' || commentAuthorRole === 'moderator';