sfc-utils 1.3.75 → 1.4.0

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.
@@ -1,4 +1,5 @@
1
1
  import { getBlueconic } from "../../blueconic"
2
+ import { getBrands2 } from "../../brands2"
2
3
  import { appCheck, blendHDN } from "../../index"
3
4
 
4
5
  /** Used for resizing the WCM Image */
@@ -13,7 +14,7 @@ function debounce(fn, ms) {
13
14
  }
14
15
  }
15
16
 
16
- function appendLayoutScripts(isEmbedded, isAdRemoved) {
17
+ function appendLayoutScripts(isEmbedded, isAdRemoved, marketKey) {
17
18
  const isApp = appCheck();
18
19
 
19
20
  // React Helmet is actually terrible and runs these scripts twice, so we are including them async ourselves
@@ -49,8 +50,8 @@ function appendLayoutScripts(isEmbedded, isAdRemoved) {
49
50
  document.body.appendChild(script)
50
51
 
51
52
  // Init sailthru
52
- if (window && window.Sailthru){
53
- window.Sailthru.init({ customerId: thisBrand.attributes.sailCustomer })
53
+ if (window && window.Sailthru && marketKey){
54
+ window.Sailthru.init({ customerId: getBrands2(marketKey).attributes.sailCustomer })
54
55
  }
55
56
  }
56
57
  }, 5000)
@@ -58,6 +59,7 @@ function appendLayoutScripts(isEmbedded, isAdRemoved) {
58
59
 
59
60
  function formatHDN(isEmbedded, url_add, meta) {
60
61
  const isApp = appCheck();
62
+ const thisBrand = getBrands2(meta.PROJECT.MARKET_KEY);
61
63
 
62
64
  // Combine our settings with what Hearst puts on page
63
65
  let stringHDN = ''
@@ -66,7 +68,7 @@ function formatHDN(isEmbedded, url_add, meta) {
66
68
  const metaHDN = Object.assign({}, meta)
67
69
  metaHDN.URL_ADD = url_add
68
70
  // Add sailthru var
69
- metaHDN.SAIL_CUST = thisBrand.attributes.sailCustomer
71
+ metaHDN.SAIL_CUST = thisBrand.attributes.sailCustomer;
70
72
  // Make sure this is free on app
71
73
  if (isApp) {
72
74
  metaHDN.PAYWALL_SETTING = "free"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfc-utils",
3
- "version": "1.3.75",
3
+ "version": "1.4.0",
4
4
  "author": "ewagstaff <evanjwagstaff@gmail.com>",
5
5
  "dependencies": {
6
6
  "archieml": "^0.4.2",