1
0
mirror of https://github.com/oceanprotocol/react.git synced 2024-11-26 12:29:01 +01:00

fix useMetadata fallback

This commit is contained in:
Matthias Kretschmann 2020-07-22 14:09:16 +02:00
parent 457a4aaba5
commit 17ed5f1013
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -20,7 +20,7 @@ interface UseMetadata {
}
function useMetadata(did?: DID | string): UseMetadata {
const { ocean, status } = useOcean()
const { ocean, status, config } = useOcean()
const [ddo, setDDO] = useState<DDO | undefined>()
const [metadata, setMetadata] = useState<Metadata | undefined>()
const [title, setTitle] = useState<string | undefined>()
@ -32,8 +32,7 @@ function useMetadata(did?: DID | string): UseMetadata {
}
// fallback hitting MetadataStore directly
const { metadataStoreUri } = new ConfigHelper()
const metadataStore = new MetadataStore(metadataStoreUri, Logger)
const metadataStore = new MetadataStore(config.metadataStoreUri, Logger)
const ddo = await metadataStore.retrieveDDO(did)
return ddo
}