sfc-utils 1.4.182 → 1.4.183

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.
package/accountswap.js CHANGED
@@ -13,7 +13,12 @@ const attachSigninHandler = async function () {
13
13
  if (signinButton && !signinButton.dataset.realmAttached) {
14
14
  signinButton.dataset.realmAttached = "true";
15
15
  signinButton.onclick = function (e) {
16
- if (window && window.treg && window.treg.realm && window.treg.realm.core) {
16
+ if (
17
+ window &&
18
+ window.treg &&
19
+ window.treg.realm &&
20
+ window.treg.realm.core
21
+ ) {
17
22
  window.treg.realm.core.login();
18
23
  }
19
24
  e.preventDefault();
@@ -34,11 +39,21 @@ const swapSubscribeForAccount = async function () {
34
39
  const maxTries = 20; // 20 * 500ms = 10 seconds
35
40
  while (!swapped && tries < maxTries) {
36
41
  tries++;
37
- if (window && window.treg && window.treg.identity && window.treg.identity.id) {
42
+ if (
43
+ window &&
44
+ window.treg &&
45
+ window.treg.identity &&
46
+ window.treg.identity.id
47
+ ) {
38
48
  const rightBlock = document.querySelector(".nav2-right");
39
49
  if (rightBlock && rightBlock.innerText) {
40
50
  rightBlock.innerHTML = `<a id="nav2-sub-box" href="${accountURL}"><div>Account</div></a>`;
41
- if (window && window.treg && window.treg.realm && window.treg.realm.iframeProfile) {
51
+ if (
52
+ window &&
53
+ window.treg &&
54
+ window.treg.realm &&
55
+ window.treg.realm.iframeProfile
56
+ ) {
42
57
  const subButton = document.querySelector("#nav2-sub-box");
43
58
  if (subButton) {
44
59
  subButton.onclick = function (e) {
@@ -27,7 +27,7 @@ const LayoutHelmet = ({
27
27
  MARKET_KEY,
28
28
  CANONICAL_URL,
29
29
  ANALYTICS_CREDIT,
30
- SECTION,
30
+ HEARST_CATEGORY,
31
31
  },
32
32
  } = meta;
33
33
 
@@ -128,8 +128,8 @@ const LayoutHelmet = ({
128
128
 
129
129
  // Set section with fallback
130
130
  let articleSection = "Local";
131
- if (SECTION) {
132
- articleSection = SECTION;
131
+ if (HEARST_CATEGORY && typeof HEARST_CATEGORY === "string") {
132
+ articleSection = HEARST_CATEGORY.split(",")[0];
133
133
  }
134
134
 
135
135
  // Set the default schema that will be used as a fallback
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfc-utils",
3
- "version": "1.4.182",
3
+ "version": "1.4.183",
4
4
  "author": "ewagstaff <evanjwagstaff@gmail.com>",
5
5
  "dependencies": {
6
6
  "archieml": "^0.4.2",