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()
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user