Avoid escaping line breaks in token and collection descriptions
This commit is contained in:
parent
b66c6befd2
commit
3d527c6682
@ -435,6 +435,8 @@ export const OpenEditionMinterCreator = ({
|
||||
if (getAssetType(offChainMetadataUploadDetails.assetFiles[0].name) !== 'html')
|
||||
data.image = `ipfs://${assetUri}/${offChainMetadataUploadDetails.assetFiles[0].name}`
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
data.description = data.description.replace('\\n', '\n')
|
||||
const metadataFileBlob = new Blob([JSON.stringify(data)], {
|
||||
type: 'application/json',
|
||||
})
|
||||
@ -496,7 +498,7 @@ export const OpenEditionMinterCreator = ({
|
||||
? {
|
||||
image: uri,
|
||||
name: onChainMetadataInputDetails?.name,
|
||||
description: onChainMetadataInputDetails?.description,
|
||||
description: onChainMetadataInputDetails?.description?.replace('\\n', '\n'),
|
||||
attributes: onChainMetadataInputDetails?.attributes,
|
||||
external_url: onChainMetadataInputDetails?.external_url,
|
||||
animation_url:
|
||||
@ -524,7 +526,7 @@ export const OpenEditionMinterCreator = ({
|
||||
symbol: collectionDetails?.symbol,
|
||||
info: {
|
||||
creator: wallet.address,
|
||||
description: collectionDetails?.description,
|
||||
description: collectionDetails?.description.replace('\\n', '\n'),
|
||||
image: coverImageUri,
|
||||
explicit_content: collectionDetails?.explicit || false,
|
||||
royalty_info: royaltyInfo,
|
||||
|
@ -189,7 +189,7 @@ const BadgeCreationPage: NextPage = () => {
|
||||
manager: badgeDetails?.manager as string,
|
||||
metadata: {
|
||||
name: badgeDetails?.name || undefined,
|
||||
description: badgeDetails?.description || undefined,
|
||||
description: badgeDetails?.description?.replace('\\n', '\n') || undefined,
|
||||
image: coverUrl || undefined,
|
||||
image_data: badgeDetails?.image_data || undefined,
|
||||
external_url: badgeDetails?.external_url || undefined,
|
||||
|
@ -547,7 +547,7 @@ const CollectionCreationPage: NextPage = () => {
|
||||
symbol: collectionDetails?.symbol,
|
||||
info: {
|
||||
creator: wallet.address,
|
||||
description: collectionDetails?.description,
|
||||
description: collectionDetails?.description.replace('\\n', '\n'),
|
||||
image: `${
|
||||
uploadDetails?.uploadMethod === 'new'
|
||||
? `ipfs://${coverImageUri}/${collectionDetails?.imageFile[0].name as string}`
|
||||
@ -613,7 +613,7 @@ const CollectionCreationPage: NextPage = () => {
|
||||
symbol: collectionDetails?.symbol,
|
||||
info: {
|
||||
creator: wallet.address,
|
||||
description: collectionDetails?.description,
|
||||
description: collectionDetails?.description.replace('\\n', '\n'),
|
||||
image: `${
|
||||
uploadDetails?.uploadMethod === 'new'
|
||||
? `ipfs://${coverImageUri}/${collectionDetails?.imageFile[0].name as string}`
|
||||
@ -735,6 +735,8 @@ const CollectionCreationPage: NextPage = () => {
|
||||
if (getAssetType(uploadDetails.assetFiles[i].name) !== 'html')
|
||||
data.image = `ipfs://${assetUri}/${uploadDetails.assetFiles[i].name}`
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
data.description = data.description.replace('\\n', '\n')
|
||||
const metadataFileBlob = new Blob([JSON.stringify(data)], {
|
||||
type: 'application/json',
|
||||
})
|
||||
@ -789,6 +791,8 @@ const CollectionCreationPage: NextPage = () => {
|
||||
type: 'application/json',
|
||||
})
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
data.description = data.description.replace('\\n', '\n')
|
||||
console.log('Name: ', (uploadDetails.baseMinterMetadataFile as File).name)
|
||||
const updatedMetadataFile = new File(
|
||||
[metadataFileBlob],
|
||||
|
Loading…
Reference in New Issue
Block a user