@financial-times/ads-display
Advanced tools
Comparing version 5.1.2 to 5.1.3
@@ -6,4 +6,4 @@ import oAds from '@financial-times/ads-legacy-o-ads'; | ||
import oTracking from '@financial-times/o-tracking'; | ||
import { broadcast } from '@financial-times/n-tracking'; | ||
import { getPersonalisedConsent } from '@financial-times/ads-personalised-consent'; | ||
import { broadcast } from '@financial-times/n-tracking'; | ||
import adsPermutive from '@financial-times/ads-permutive'; | ||
@@ -118,16 +118,2 @@ | ||
let pc; | ||
const _getPersonalisedConsent = async () => { | ||
if (!pc) { | ||
try { | ||
pc = getPersonalisedConsent(); | ||
} catch (e) { | ||
console.warn("Failed to initialise PersonaliseConsent", e); | ||
} | ||
} | ||
return pc; | ||
}; | ||
const DEFAULT_ADS_API_HOST = "https://ads-api.ft.com/v2"; | ||
@@ -358,8 +344,5 @@ | ||
user, | ||
host, | ||
pc | ||
host | ||
}) => { | ||
var _pc$isAllowed; | ||
if (user && pc !== null && pc !== void 0 && (_pc$isAllowed = pc.isAllowed()) !== null && _pc$isAllowed !== void 0 && _pc$isAllowed.demographic) { | ||
if (user) { | ||
return fetchUserData(host); | ||
@@ -405,7 +388,5 @@ } | ||
}) { | ||
const pc = await _getPersonalisedConsent(); | ||
const adsApiRequests = [getUserData({ | ||
user, | ||
host, | ||
pc | ||
host | ||
}), getPageData({ | ||
@@ -518,2 +499,16 @@ page, | ||
let pc; | ||
const _getPersonalisedConsent = async () => { | ||
if (!pc) { | ||
try { | ||
pc = getPersonalisedConsent(); | ||
} catch (e) { | ||
console.warn("Failed to initialise PersonaliseConsent", e); | ||
} | ||
} | ||
return pc; | ||
}; | ||
/** | ||
@@ -520,0 +515,0 @@ * @typedef {Object} oAdsMetricPayload |
@@ -17,6 +17,6 @@ { | ||
"dependencies": { | ||
"@financial-times/ads-legacy-o-ads": "^5.1.2", | ||
"@financial-times/ads-moat-integration": "^5.1.2", | ||
"@financial-times/ads-permutive": "^5.1.2", | ||
"@financial-times/ads-personalised-consent": "^5.1.2", | ||
"@financial-times/ads-legacy-o-ads": "^5.1.3", | ||
"@financial-times/ads-moat-integration": "^5.1.3", | ||
"@financial-times/ads-permutive": "^5.1.3", | ||
"@financial-times/ads-personalised-consent": "^5.1.3", | ||
"@financial-times/n-tracking": "^4.0.1", | ||
@@ -34,3 +34,3 @@ "@financial-times/o-tracking": "^4.0.0", | ||
}, | ||
"version": "5.1.2" | ||
"version": "5.1.3" | ||
} |
46926
886