@intuned/runtime-dev 1.0.0-udas.4 → 1.0.0-udas.5

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.
@@ -35,16 +35,24 @@ async function getContextStorageState(context) {
35
35
  };
36
36
  }
37
37
  async function setContextStorageState(context, storage) {
38
+ console.log("Setting storage state");
38
39
  await context.intunedSetStorageState(storage);
40
+ console.log("Storage state set");
39
41
  const sessionStorage = storage.sessionStorage;
42
+ console.log("Adding init script session");
40
43
  await context.addInitScript(storage => {
41
44
  for (const {
42
45
  origin,
43
46
  sessionStorage
44
47
  } of storage) {
45
48
  if (window.location.origin === origin) {
46
- for (const item of sessionStorage) window.sessionStorage.setItem(item.name, item.value);
49
+ for (const item of sessionStorage) {
50
+ const existingItem = window.sessionStorage.getItem(item.name);
51
+ if (existingItem !== null) continue;
52
+ window.sessionStorage.setItem(item.name, item.value);
53
+ }
47
54
  }
48
55
  }
49
56
  }, sessionStorage);
57
+ console.log("Added init script session");
50
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.0.0-udas.4",
3
+ "version": "1.0.0-udas.5",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",