@guardian/commercial-core 5.4.2 → 5.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -64,7 +64,7 @@ function sendMetrics() {
64
64
  *
65
65
  * Relevant for an @guardian/open-journalism investigation.
66
66
  */
67
- const getOfflineCount = () => window.guardian.offlineCount
67
+ const getOfflineCount = () => typeof window.guardian.offlineCount === 'number'
68
68
  ? [
69
69
  {
70
70
  name: 'offlineCount',
@@ -30,7 +30,7 @@ const buildPageTargeting = ({ adFree, clientSideParticipations, consentState, yo
30
30
  const adFreeTargeting = adFree ? { af: 't' } : {};
31
31
  const contentTargeting = (0, content_1.getContentTargeting)({
32
32
  webPublicationDate: page.webPublicationDate,
33
- eligibleForDCR: isDotcomRendering,
33
+ eligibleForDCR: page.dcrCouldRender,
34
34
  path: `/${page.pageId}`,
35
35
  renderingPlatform: isDotcomRendering
36
36
  ? 'dotcom-rendering'
@@ -36,6 +36,7 @@ export type GuardianWindowConfig = {
36
36
  pageViewId: string;
37
37
  };
38
38
  page: {
39
+ dcrCouldRender: boolean;
39
40
  edition: Edition;
40
41
  isPreview: boolean;
41
42
  isSensitive: boolean;
@@ -61,7 +61,7 @@ function sendMetrics() {
61
61
  *
62
62
  * Relevant for an @guardian/open-journalism investigation.
63
63
  */
64
- const getOfflineCount = () => window.guardian.offlineCount
64
+ const getOfflineCount = () => typeof window.guardian.offlineCount === 'number'
65
65
  ? [
66
66
  {
67
67
  name: 'offlineCount',
@@ -26,7 +26,7 @@ const buildPageTargeting = ({ adFree, clientSideParticipations, consentState, yo
26
26
  const adFreeTargeting = adFree ? { af: 't' } : {};
27
27
  const contentTargeting = getContentTargeting({
28
28
  webPublicationDate: page.webPublicationDate,
29
- eligibleForDCR: isDotcomRendering,
29
+ eligibleForDCR: page.dcrCouldRender,
30
30
  path: `/${page.pageId}`,
31
31
  renderingPlatform: isDotcomRendering
32
32
  ? 'dotcom-rendering'
@@ -36,6 +36,7 @@ export type GuardianWindowConfig = {
36
36
  pageViewId: string;
37
37
  };
38
38
  page: {
39
+ dcrCouldRender: boolean;
39
40
  edition: Edition;
40
41
  isPreview: boolean;
41
42
  isSensitive: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardian/commercial-core",
3
- "version": "5.4.2",
3
+ "version": "5.4.4",
4
4
  "description": "Guardian advertising business logic",
5
5
  "homepage": "https://github.com/guardian/commercial-core#readme",
6
6
  "bugs": {