mirror of
https://github.com/oceanprotocol/react.git
synced 2025-02-14 21:10:38 +01:00
fix useMetadata fallback
This commit is contained in:
parent
457a4aaba5
commit
17ed5f1013
@ -20,7 +20,7 @@ interface UseMetadata {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function useMetadata(did?: DID | string): UseMetadata {
|
function useMetadata(did?: DID | string): UseMetadata {
|
||||||
const { ocean, status } = useOcean()
|
const { ocean, status, config } = useOcean()
|
||||||
const [ddo, setDDO] = useState<DDO | undefined>()
|
const [ddo, setDDO] = useState<DDO | undefined>()
|
||||||
const [metadata, setMetadata] = useState<Metadata | undefined>()
|
const [metadata, setMetadata] = useState<Metadata | undefined>()
|
||||||
const [title, setTitle] = useState<string | undefined>()
|
const [title, setTitle] = useState<string | undefined>()
|
||||||
@ -32,8 +32,7 @@ function useMetadata(did?: DID | string): UseMetadata {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fallback hitting MetadataStore directly
|
// fallback hitting MetadataStore directly
|
||||||
const { metadataStoreUri } = new ConfigHelper()
|
const metadataStore = new MetadataStore(config.metadataStoreUri, Logger)
|
||||||
const metadataStore = new MetadataStore(metadataStoreUri, Logger)
|
|
||||||
const ddo = await metadataStore.retrieveDDO(did)
|
const ddo = await metadataStore.retrieveDDO(did)
|
||||||
return ddo
|
return ddo
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user