1
0
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:
Jamie Hewitt 2021-06-01 18:21:09 +03:00
parent 3451aac42e
commit 5c627be73f

View File

@ -15,12 +15,13 @@ export default function Permission({
const { accountId } = useWeb3()
useEffect(() => {
const getData = async () => {
const data = await rbacRequest(eventType, accountId)
updateData(data)
if (accountId !== undefined) {
const data = await rbacRequest(eventType, accountId)
updateData(data)
}
}
getData()
}, [eventType, accountId])
console.log('eventType', eventType)
if (data === true) {
return <>{children}</>
} else if (data === false) {