ublo-lib 1.32.2 → 1.32.4

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.
@@ -122,8 +122,9 @@ function getBusinessProvider() {
122
122
  const businessProvider = window.localStorage.getItem("businessProvider");
123
123
  if (businessProvider) {
124
124
  try {
125
- const { id } = JSON.parse(businessProvider);
126
- if (id !== -1) {
125
+ const { id, exp } = JSON.parse(businessProvider);
126
+ const isExpired = exp < Date.now();
127
+ if (!isExpired && id !== -1) {
127
128
  return id;
128
129
  }
129
130
  }
@@ -1 +1 @@
1
- {"version":3,"file":"use-affiliation.d.ts","sourceRoot":"","sources":["../../../src/esf/hooks/use-affiliation.js"],"names":[],"mappings":"AAMA,+CAaC"}
1
+ {"version":3,"file":"use-affiliation.d.ts","sourceRoot":"","sources":["../../../src/esf/hooks/use-affiliation.js"],"names":[],"mappings":"AAMA,+CAcC"}
@@ -7,8 +7,9 @@ export default function useAffiliation() {
7
7
  const storedChecker = window.sessionStorage.getItem(CHECKER_STORAGE_KEY);
8
8
  const storedBusinessProvider = window.localStorage.getItem(STORAGE_KEY);
9
9
  if (!storedChecker && storedBusinessProvider) {
10
- const { id } = JSON.parse(storedBusinessProvider);
11
- if (id !== -1) {
10
+ const { id, exp } = JSON.parse(storedBusinessProvider);
11
+ const isExpired = exp < Date.now();
12
+ if (!isExpired && id !== -1) {
12
13
  Plausible.sendGoal("Affiliation", { id });
13
14
  window.sessionStorage.setItem(CHECKER_STORAGE_KEY, "true");
14
15
  }
@@ -122,8 +122,9 @@ function getBusinessProvider() {
122
122
  const businessProvider = window.localStorage.getItem("businessProvider");
123
123
  if (businessProvider) {
124
124
  try {
125
- const { id } = JSON.parse(businessProvider);
126
- if (id !== -1) {
125
+ const { id, exp } = JSON.parse(businessProvider);
126
+ const isExpired = exp < Date.now();
127
+ if (!isExpired && id !== -1) {
127
128
  return id;
128
129
  }
129
130
  }
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.32.2",
4
- "type": "module",
3
+ "version": "1.32.4",
5
4
  "peerDependencies": {
6
5
  "dt-design-system": "^3.8.5",
7
6
  "leaflet": "^1.9.1",