Skip to content

Commit

Permalink
fixed return in setCtaHash
Browse files Browse the repository at this point in the history
  • Loading branch information
mirafedas committed Sep 18, 2024
1 parent de1e8be commit b5ccd30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/blocks/merch/merch.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ export async function openModal(e, url, offerType, hash) {
}

export function setCtaHash(el, checkoutLinkConfig, offerType) {
if (!(el && checkoutLinkConfig && offerType)) return;
if (!(el && checkoutLinkConfig && offerType)) return undefined;
const authoredHash = checkoutLinkConfig[`${(offerType === OFFER_TYPE_TRIAL) ? FREE_TRIAL_HASH : BUY_NOW_HASH}`];
const autogeneratedHash = `${offerType === 'TRIAL' ? 'try' : 'buy'}-${el.closest('merch-card')?.getAttribute('name')}`;
const hash = authoredHash ?? autogeneratedHash;
Expand Down

0 comments on commit b5ccd30

Please sign in to comment.