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:
parent
939c577483
commit
4b4cda4906
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user