1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-13 16:54:53 +01:00

resolve promise using async/await

This commit is contained in:
Norbi 2021-03-01 16:54:43 +02:00
parent 939c577483
commit 4b4cda4906

View File

@ -29,11 +29,12 @@ export default function AssetListTitle({
const source = axios.CancelToken.source()
async function getAssetName() {
getAssetsNames([did], config.metadataCacheUri, source.token).then(
(resp) => {
setAssetTitle(resp[did])
}
const title = await getAssetsNames(
[did],
config.metadataCacheUri,
source.token
)
setAssetTitle(title[did])
}
!ddo && did && getAssetName()