@chrryai/chrry 1.4.78 → 1.4.80
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/index.js +14 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1899,7 +1899,7 @@ var init_utils = __esm({
|
|
|
1899
1899
|
};
|
|
1900
1900
|
isFirefox = typeof navigator !== "undefined" && navigator?.userAgent?.includes("Firefox");
|
|
1901
1901
|
config = getSiteConfig(getClientHostname());
|
|
1902
|
-
VERSION = config.version || "1.4.
|
|
1902
|
+
VERSION = config.version || "1.4.80";
|
|
1903
1903
|
getSlugFromPathname = (path) => {
|
|
1904
1904
|
return getAppAndStoreSlugs(path, {
|
|
1905
1905
|
defaultAppSlug: config.slug,
|
|
@@ -22985,18 +22985,15 @@ function AuthProvider({
|
|
|
22985
22985
|
}, [deviceId, setDeviceId, isStorageReady]);
|
|
22986
22986
|
const [enableNotifications, setEnableNotifications] = useLocalStorage2("enableNotifications", true);
|
|
22987
22987
|
const [shouldFetchSession, setShouldFetchSession] = (0, import_react19.useState)(!session2);
|
|
22988
|
-
const [fingerprint,
|
|
22988
|
+
const [fingerprint, setFingerprint] = useCookieOrLocalStorage(
|
|
22989
22989
|
"fingerprint",
|
|
22990
22990
|
session2?.guest?.fingerprint || session2?.user?.fingerprint || fingerprintParam
|
|
22991
22991
|
);
|
|
22992
|
-
const setFingerprint = (fingerprint2) => {
|
|
22993
|
-
};
|
|
22994
22992
|
const [token, setTokenInternal] = useCookieOrLocalStorage(
|
|
22995
22993
|
"token",
|
|
22996
22994
|
session2?.user?.token || session2?.guest?.fingerprint || apiKey,
|
|
22997
22995
|
isExtension2
|
|
22998
22996
|
);
|
|
22999
|
-
console.log(`\u{1F680} ~ DataProvider ~ token:`, token);
|
|
23000
22997
|
const [isCookieReady, setIsCookieReady] = (0, import_react19.useState)(false);
|
|
23001
22998
|
(0, import_react19.useEffect)(() => {
|
|
23002
22999
|
if (isExtension2) {
|
|
@@ -23023,7 +23020,6 @@ function AuthProvider({
|
|
|
23023
23020
|
}
|
|
23024
23021
|
}, [isExtension2]);
|
|
23025
23022
|
const setToken = (token2) => {
|
|
23026
|
-
console.log(`\u{1F680} ~ setToken ~ token:`, token2);
|
|
23027
23023
|
setTokenInternal(token2 || "");
|
|
23028
23024
|
};
|
|
23029
23025
|
(0, import_react19.useEffect)(() => {
|
|
@@ -23575,12 +23571,6 @@ function AuthProvider({
|
|
|
23575
23571
|
setIsLoading(false);
|
|
23576
23572
|
}
|
|
23577
23573
|
}, [user, guest, isSessionLoading]);
|
|
23578
|
-
(0, import_react19.useEffect)(() => {
|
|
23579
|
-
if (user && migratedFromGuestRef.current) {
|
|
23580
|
-
migratedFromGuestRef.current = false;
|
|
23581
|
-
fetchSession();
|
|
23582
|
-
}
|
|
23583
|
-
}, [user]);
|
|
23584
23574
|
const { setColorScheme, setTheme } = useTheme2();
|
|
23585
23575
|
const [showCharacterProfiles, setShowCharacterProfiles] = (0, import_react19.useState)(false);
|
|
23586
23576
|
const [characterProfiles, setCharacterProfiles] = (0, import_react19.useState)([]);
|
|
@@ -23894,6 +23884,7 @@ function AuthProvider({
|
|
|
23894
23884
|
storeApp,
|
|
23895
23885
|
store,
|
|
23896
23886
|
stores,
|
|
23887
|
+
migratedFromGuestRef,
|
|
23897
23888
|
setStore,
|
|
23898
23889
|
setStores,
|
|
23899
23890
|
getAppSlug,
|
|
@@ -24070,7 +24061,7 @@ function DataProvider({ children, ...rest }) {
|
|
|
24070
24061
|
const [instructions, setInstructions] = (0, import_react21.useState)([]);
|
|
24071
24062
|
const [affiliateStats, setAffiliateStats] = (0, import_react21.useState)(null);
|
|
24072
24063
|
const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react21.useState)(false);
|
|
24073
|
-
const VERSION4 = "1.4.
|
|
24064
|
+
const VERSION4 = "1.4.80";
|
|
24074
24065
|
const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
|
|
24075
24066
|
const {
|
|
24076
24067
|
API_URL: API_URL2,
|
|
@@ -26076,6 +26067,8 @@ function ChatProvider({
|
|
|
26076
26067
|
favouriteAgent,
|
|
26077
26068
|
threadId,
|
|
26078
26069
|
setThreadId,
|
|
26070
|
+
migratedFromGuestRef,
|
|
26071
|
+
fetchSession,
|
|
26079
26072
|
loadingApp,
|
|
26080
26073
|
setLoadingApp,
|
|
26081
26074
|
...auth
|
|
@@ -26113,15 +26106,21 @@ function ChatProvider({
|
|
|
26113
26106
|
};
|
|
26114
26107
|
loadCachedThreads();
|
|
26115
26108
|
}, [app?.id, user?.id, guest?.id]);
|
|
26109
|
+
(0, import_react31.useEffect)(() => {
|
|
26110
|
+
if (user && migratedFromGuestRef.current) {
|
|
26111
|
+
migratedFromGuestRef.current = false;
|
|
26112
|
+
fetchSession();
|
|
26113
|
+
refetchThreads();
|
|
26114
|
+
}
|
|
26115
|
+
}, [user]);
|
|
26116
26116
|
const {
|
|
26117
26117
|
data: threadsData,
|
|
26118
26118
|
mutate: refetchThreads,
|
|
26119
26119
|
isLoading: isLoadingThreadsSwr,
|
|
26120
26120
|
error: threadsError
|
|
26121
26121
|
} = (0, import_swr3.default)(
|
|
26122
|
-
shouldFetchThreads ? ["contextThreads", thread2?.id, app?.id] : null,
|
|
26122
|
+
shouldFetchThreads ? ["contextThreads", thread2?.id, app?.id, token] : null,
|
|
26123
26123
|
async () => {
|
|
26124
|
-
if (!(user || guest)) return;
|
|
26125
26124
|
const key = `threads-${app?.id}-${user?.id || guest?.id}`;
|
|
26126
26125
|
try {
|
|
26127
26126
|
const threads2 = await actions.getThreads({
|
|
@@ -37404,7 +37403,6 @@ Return ONLY ONE WORD: ${apps.map((a) => a.name).join(", ")}, or "none"`;
|
|
|
37404
37403
|
}
|
|
37405
37404
|
};
|
|
37406
37405
|
const clearFiles = () => setFiles([]);
|
|
37407
|
-
console.log(`\u{1F680} ~ file: hat.tsx:1047 ~ device:`, device);
|
|
37408
37406
|
const removeFile = (index) => {
|
|
37409
37407
|
setFilesInternal((prev2) => prev2.filter((_, i) => i !== index));
|
|
37410
37408
|
device === "desktop" && setShouldFocus(true);
|