mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix mod role check
This commit is contained in:
@@ -90,7 +90,7 @@ const Board = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (subplebbit.roles !== undefined) {
|
if (subplebbit.roles !== undefined) {
|
||||||
const role = subplebbit.roles[account.address]?.role;
|
const role = subplebbit.roles[account.author.address]?.role;
|
||||||
|
|
||||||
if (role === 'moderator' || role === 'admin' || role === 'owner') {
|
if (role === 'moderator' || role === 'admin' || role === 'owner') {
|
||||||
setIsModerator(true);
|
setIsModerator(true);
|
||||||
@@ -98,7 +98,7 @@ const Board = () => {
|
|||||||
setIsModerator(false);
|
setIsModerator(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [account?.address, subplebbit.roles]);
|
}, [account?.author.address, subplebbit.roles]);
|
||||||
|
|
||||||
|
|
||||||
const handleOptionClick = (threadCid) => {
|
const handleOptionClick = (threadCid) => {
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ const Thread = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (subplebbit.roles !== undefined) {
|
if (subplebbit.roles !== undefined) {
|
||||||
const role = subplebbit.roles[account.address]?.role;
|
const role = subplebbit.roles[account.author.address]?.role;
|
||||||
|
|
||||||
if (role === 'moderator' || role === 'admin' || role === 'owner') {
|
if (role === 'moderator' || role === 'admin' || role === 'owner') {
|
||||||
setIsModerator(true);
|
setIsModerator(true);
|
||||||
@@ -99,7 +99,8 @@ const Thread = () => {
|
|||||||
setIsModerator(false);
|
setIsModerator(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [account?.address, subplebbit.roles]);
|
}, [account?.author.address, subplebbit.roles]);
|
||||||
|
|
||||||
|
|
||||||
const handleOptionClick = (threadCid) => {
|
const handleOptionClick = (threadCid) => {
|
||||||
setRotatedStates(prevState => ({
|
setRotatedStates(prevState => ({
|
||||||
|
|||||||
Reference in New Issue
Block a user