1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-07-01 06:11:43 +02: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()