Apply empty string to URL in event that vendorUrl is absent

This commit is contained in:
Dan Q 2023-09-19 11:39:01 +01:00
parent 5e88b001fa
commit dcd08ac1b6
1 changed files with 10 additions and 6 deletions

View File

@ -22,12 +22,16 @@ export default function ProductListContent( props: {
title: product.title,
icon: product.icon,
vendorName: product.vendorName,
vendorUrl: appendURLParams( product.vendorUrl, [
[ 'utm_source', 'extensionsscreen' ],
[ 'utm_medium', 'product' ],
[ 'utm_campaign', 'wcaddons' ],
[ 'utm_content', 'devpartner' ],
] ),
vendorUrl: (
product.vendorUrl ?
appendURLParams( product.vendorUrl, [
[ 'utm_source', 'extensionsscreen' ],
[ 'utm_medium', 'product' ],
[ 'utm_campaign', 'wcaddons' ],
[ 'utm_content', 'devpartner' ],
] ) :
''
),
price: product.price,
url: appendURLParams(
product.url,