Skip to content

Commit

Permalink
ecid
Browse files Browse the repository at this point in the history
  • Loading branch information
Drashti Modasara authored and Drashti Modasara committed Jan 9, 2025
1 parent 0407f04 commit 0ddb057
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libs/features/branch-quick-links/branch-quick-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ function removeBarLoader(elem, a) {

async function decorateQuickLink(a, hasConsent) {
if (!window.alloy) return;
const { getECID } = await import('../../blocks/mobile-app-banner/mobile-app-banner.js');
const ecid = await getECID();
let ecid = null;
try {
const data = await window.alloy('getIdentity');
ecid = data?.identity?.ECID;
} catch (e) {
window.lana.log(`Error fetching ECID: ${e}`, { tags: 'branch-quick-links' });
}
if (hasConsent && !a.href.includes('ecid')) {
a.href = a.href.concat(`?ecid=${ecid}`);
}
Expand Down

0 comments on commit 0ddb057

Please sign in to comment.