mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
only sending request to RBAC if address is defined
This commit is contained in:
parent
3451aac42e
commit
5c627be73f
@ -15,12 +15,13 @@ export default function Permission({
|
|||||||
const { accountId } = useWeb3()
|
const { accountId } = useWeb3()
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
|
if (accountId !== undefined) {
|
||||||
const data = await rbacRequest(eventType, accountId)
|
const data = await rbacRequest(eventType, accountId)
|
||||||
updateData(data)
|
updateData(data)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
getData()
|
getData()
|
||||||
}, [eventType, accountId])
|
}, [eventType, accountId])
|
||||||
console.log('eventType', eventType)
|
|
||||||
if (data === true) {
|
if (data === true) {
|
||||||
return <>{children}</>
|
return <>{children}</>
|
||||||
} else if (data === false) {
|
} else if (data === false) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user