sfc-utils 1.4.173 → 1.4.174

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.
Files changed (2) hide show
  1. package/accountswap.js +3 -3
  2. package/package.json +1 -1
package/accountswap.js CHANGED
@@ -13,7 +13,7 @@ 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?.treg?.realm?.core) {
16
+ if (window && window.treg && window.treg.realm && window.treg.realm.core) {
17
17
  window.treg.realm.core.login();
18
18
  }
19
19
  e.preventDefault();
@@ -34,11 +34,11 @@ const swapSubscribeForAccount = async function () {
34
34
  const maxTries = 20; // 20 * 500ms = 10 seconds
35
35
  while (!swapped && tries < maxTries) {
36
36
  tries++;
37
- if (window?.treg?.identity?.id) {
37
+ if (window && window.treg && window.treg.identity && window.treg.identity.id) {
38
38
  const rightBlock = document.querySelector(".nav2-right");
39
39
  if (rightBlock && rightBlock.innerText) {
40
40
  rightBlock.innerHTML = `<a id="nav2-sub-box" href="${accountURL}"><div>Account</div></a>`;
41
- if (window?.treg?.realm?.iframeProfile) {
41
+ if (window && window.treg && window.treg.realm && window.treg.realm.iframeProfile) {
42
42
  const subButton = document.querySelector("#nav2-sub-box");
43
43
  if (subButton) {
44
44
  subButton.onclick = function (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfc-utils",
3
- "version": "1.4.173",
3
+ "version": "1.4.174",
4
4
  "author": "ewagstaff <evanjwagstaff@gmail.com>",
5
5
  "dependencies": {
6
6
  "archieml": "^0.4.2",