@amedia/user 0.13.40 → 0.13.42

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amedia/user",
3
- "version": "0.13.40",
3
+ "version": "0.13.42",
4
4
  "description": "Client lib for working with aID user and associated data",
5
5
  "repository": "https://github.com/amedia/amedia-user-js",
6
6
  "author": "Amedia Utvikling (ID og data)",
@@ -17,7 +17,7 @@ declare global {
17
17
  }
18
18
 
19
19
  const getStorage = () => {
20
- const rootObject = globalThis;
20
+ const rootObject = getGlobalThis();
21
21
  // eslint-disable-next-line no-return-assign
22
22
  return rootObject.amediaUserCache || (rootObject.amediaUserCache = {});
23
23
  };
@@ -4,6 +4,7 @@ import { dispatch, listenWithExclusivity } from '../utils/customEventWrapper';
4
4
  import { attemptAutoLoginJob } from '../autologin';
5
5
  import daxSubCookieHandler from './jobs/daxsubCookie';
6
6
  import log from '../utils/log';
7
+ import getGlobalThis from '../utils/getGlobalThis';
7
8
 
8
9
  const jobs = [
9
10
  attemptAutoLoginJob,
@@ -17,7 +18,7 @@ async function performJobs() {
17
18
  // None of our current jobs make any sense to run in a web worker or other settings without a window object.
18
19
  return;
19
20
  }
20
- if (globalThis?.location?.hostname === 'localhost') {
21
+ if (getGlobalThis()?.location?.hostname === 'localhost') {
21
22
  // Neither if we're running on localhost as this will never be able to resolve any data
22
23
  // eslint-disable-next-line no-console
23
24
  log.warn(
@@ -1,4 +1,5 @@
1
1
  import log from './log';
2
+ import getGlobalThis from './getGlobalThis';
2
3
 
3
4
  let rootElement: Window | Element | typeof globalThis;
4
5
 
@@ -6,7 +7,7 @@ export const setRootElement = (element: typeof rootElement) => {
6
7
  rootElement = element;
7
8
  };
8
9
 
9
- setRootElement(globalThis);
10
+ setRootElement(getGlobalThis());
10
11
 
11
12
  /**
12
13
  * This listener MUST be used by all listeners in ../eventHandlers