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
|
-
|
|
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,+
|
|
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
|
-
|
|
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
|
-
|
|
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
|
}
|