mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(hooks): remove postCid requirement from isAccountCommentAuthor check
This commit is contained in:
@@ -19,10 +19,10 @@ const useAuthorPrivileges = ({ commentAuthorAddress, subplebbitAddress, postCid
|
|||||||
const accountAuthorRole = roles?.[accountAuthorAddress]?.role;
|
const accountAuthorRole = roles?.[accountAuthorAddress]?.role;
|
||||||
const isAccountMod = accountAuthorRole === 'admin' || accountAuthorRole === 'owner' || accountAuthorRole === 'moderator';
|
const isAccountMod = accountAuthorRole === 'admin' || accountAuthorRole === 'owner' || accountAuthorRole === 'moderator';
|
||||||
|
|
||||||
const isAccountCommentAuthor = !!postCid && accountAuthorAddress === commentAuthorAddress;
|
const isAccountCommentAuthor = accountAuthorAddress === commentAuthorAddress;
|
||||||
|
|
||||||
return { isCommentAuthorMod, isAccountMod, isAccountCommentAuthor, commentAuthorRole, accountAuthorRole };
|
return { isCommentAuthorMod, isAccountMod, isAccountCommentAuthor, commentAuthorRole, accountAuthorRole };
|
||||||
}, [roles, commentAuthorAddress, accountAuthorAddress, postCid]);
|
}, [roles, commentAuthorAddress, accountAuthorAddress]);
|
||||||
|
|
||||||
return { isCommentAuthorMod, isAccountMod, isAccountCommentAuthor, commentAuthorRole, accountAuthorRole };
|
return { isCommentAuthorMod, isAccountMod, isAccountCommentAuthor, commentAuthorRole, accountAuthorRole };
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user