mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
resolve promise using async/await
This commit is contained in:
parent
939c577483
commit
4b4cda4906
@ -29,11 +29,12 @@ export default function AssetListTitle({
|
|||||||
const source = axios.CancelToken.source()
|
const source = axios.CancelToken.source()
|
||||||
|
|
||||||
async function getAssetName() {
|
async function getAssetName() {
|
||||||
getAssetsNames([did], config.metadataCacheUri, source.token).then(
|
const title = await getAssetsNames(
|
||||||
(resp) => {
|
[did],
|
||||||
setAssetTitle(resp[did])
|
config.metadataCacheUri,
|
||||||
}
|
source.token
|
||||||
)
|
)
|
||||||
|
setAssetTitle(title[did])
|
||||||
}
|
}
|
||||||
|
|
||||||
!ddo && did && getAssetName()
|
!ddo && did && getAssetName()
|
||||||
|
Loading…
Reference in New Issue
Block a user