tanya-chatbot 0.2.7 → 0.2.8
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/dist/tanya-chatbot.es.js
CHANGED
|
@@ -129,7 +129,7 @@ const wt = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
|
|
|
129
129
|
async function Ut() {
|
|
130
130
|
var a;
|
|
131
131
|
const t = localStorage.getItem("expires_in"), e = localStorage.getItem("access_token"), r = ((a = JSON.parse(sessionStorage.getItem("customerData") || "{}")) == null ? void 0 : a.isGuest) || !0;
|
|
132
|
-
if (t && e && (/* @__PURE__ */ new Date()).getTime() < parseInt(t) && r ===
|
|
132
|
+
if (t && e && (/* @__PURE__ */ new Date()).getTime() < parseInt(t) && (r === localStorage.getItem("isGuest") || !0))
|
|
133
133
|
return console.log("access token found in local storage"), { access_token: e, expires_in: t };
|
|
134
134
|
const { serverUrl: n } = wt(), o = JSON.parse(
|
|
135
135
|
sessionStorage.getItem("customerData") || "{}"
|
|
@@ -146,7 +146,7 @@ async function Ut() {
|
|
|
146
146
|
return console.log(s.data), localStorage.setItem("access_token", s.data.access_token), localStorage.setItem(
|
|
147
147
|
"expires_in",
|
|
148
148
|
String((/* @__PURE__ */ new Date()).getTime() + s.data.expires_in * 1e3)
|
|
149
|
-
), localStorage.setItem("isGuest", r), s.data;
|
|
149
|
+
), localStorage.setItem("isGuest", r ? "true" : "false"), s.data;
|
|
150
150
|
} catch (c) {
|
|
151
151
|
console.log(c);
|
|
152
152
|
}
|