Merge pull request #199 from public-awesome/avoid-escaping-line-breaks
Fix: Use replaceAll instead of replace to ignore all escaped line breaks
This commit is contained in:
commit
fa859b23d9
@ -244,7 +244,7 @@ export const CollectionActions = ({
|
||||
const resolveRoyaltyPaymentAddress = async () => {
|
||||
await resolveAddress(royaltyPaymentAddressState.value.trim(), wallet).then((resolvedAddress) => {
|
||||
setCollectionInfo({
|
||||
description: descriptionState.value.replace('\\n', '\n') || undefined,
|
||||
description: descriptionState.value.replaceAll('\\n', '\n') || undefined,
|
||||
image: imageState.value || undefined,
|
||||
explicit_content: explicitContent,
|
||||
external_link: externalLinkState.value || undefined,
|
||||
@ -265,7 +265,7 @@ export const CollectionActions = ({
|
||||
|
||||
useEffect(() => {
|
||||
setCollectionInfo({
|
||||
description: descriptionState.value.replace('\\n', '\n') || undefined,
|
||||
description: descriptionState.value.replaceAll('\\n', '\n') || undefined,
|
||||
image: imageState.value || undefined,
|
||||
explicit_content: explicitContent,
|
||||
external_link: externalLinkState.value || undefined,
|
||||
|
@ -436,7 +436,7 @@ export const OpenEditionMinterCreator = ({
|
||||
data.image = `ipfs://${assetUri}/${offChainMetadataUploadDetails.assetFiles[0].name}`
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
data.description = data.description.replace('\\n', '\n')
|
||||
data.description = data.description.replaceAll('\\n', '\n')
|
||||
const metadataFileBlob = new Blob([JSON.stringify(data)], {
|
||||
type: 'application/json',
|
||||
})
|
||||
@ -498,7 +498,7 @@ export const OpenEditionMinterCreator = ({
|
||||
? {
|
||||
image: uri,
|
||||
name: onChainMetadataInputDetails?.name,
|
||||
description: onChainMetadataInputDetails?.description?.replace('\\n', '\n'),
|
||||
description: onChainMetadataInputDetails?.description?.replaceAll('\\n', '\n'),
|
||||
attributes: onChainMetadataInputDetails?.attributes,
|
||||
external_url: onChainMetadataInputDetails?.external_url,
|
||||
animation_url:
|
||||
@ -526,7 +526,7 @@ export const OpenEditionMinterCreator = ({
|
||||
symbol: collectionDetails?.symbol,
|
||||
info: {
|
||||
creator: wallet.address,
|
||||
description: collectionDetails?.description.replace('\\n', '\n'),
|
||||
description: collectionDetails?.description.replaceAll('\\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?.replace('\\n', '\n') || undefined,
|
||||
description: badgeDetails?.description?.replaceAll('\\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.replace('\\n', '\n'),
|
||||
description: collectionDetails?.description.replaceAll('\\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.replace('\\n', '\n'),
|
||||
description: collectionDetails?.description.replaceAll('\\n', '\n'),
|
||||
image: `${
|
||||
uploadDetails?.uploadMethod === 'new'
|
||||
? `ipfs://${coverImageUri}/${collectionDetails?.imageFile[0].name as string}`
|
||||
@ -736,7 +736,7 @@ const CollectionCreationPage: NextPage = () => {
|
||||
data.image = `ipfs://${assetUri}/${uploadDetails.assetFiles[i].name}`
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
data.description = data.description.replace('\\n', '\n')
|
||||
data.description = data.description.replaceAll('\\n', '\n')
|
||||
const metadataFileBlob = new Blob([JSON.stringify(data)], {
|
||||
type: 'application/json',
|
||||
})
|
||||
@ -792,7 +792,7 @@ const CollectionCreationPage: NextPage = () => {
|
||||
})
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
data.description = data.description.replace('\\n', '\n')
|
||||
data.description = data.description.replaceAll('\\n', '\n')
|
||||
console.log('Name: ', (uploadDetails.baseMinterMetadataFile as File).name)
|
||||
const updatedMetadataFile = new File(
|
||||
[metadataFileBlob],
|
||||
|
Loading…
Reference in New Issue
Block a user