0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Added fallback for NFT title when name is missing

no-issue

Some NFT's are created without a title, for example the Bored Ape Yacht
Club collection does not name the tokens, instead just referring to them
by ID. This change falls back to the token_id, which is unqiue within
the collection to support these tokens.
This commit is contained in:
Fabien egg O'Carroll 2021-12-03 21:16:22 +02:00
parent e5068a6557
commit 94cfbb19fc

View file

@ -46,7 +46,7 @@ class NFTOEmbedProvider {
return {
version: '1.0',
type: 'nft',
title: result.body.name,
title: result.body.name ? result.body.name : `#${result.body.token_id}`,
author_name: result.body.creator.user.username,
author_url: `https://opensea.io/${result.body.creator.user.username}`,
provider_name: 'OpenSea',