@chrryai/chrry 1.6.82 → 1.6.83

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 CHANGED
@@ -3152,7 +3152,7 @@ var init_utils = __esm({
3152
3152
  };
3153
3153
  isFirefox = typeof navigator !== "undefined" && navigator?.userAgent?.includes("Firefox");
3154
3154
  config = getSiteConfig(getClientHostname());
3155
- VERSION = config.version || "1.6.82";
3155
+ VERSION = config.version || "1.6.83";
3156
3156
  getSlugFromPathname = (path) => {
3157
3157
  return getAppAndStoreSlugs(path, {
3158
3158
  defaultAppSlug: config.slug,
@@ -3803,7 +3803,6 @@ var init_cookies = __esm({
3803
3803
  init_utils();
3804
3804
  isBrowser = typeof window !== "undefined";
3805
3805
  setCookieWeb = (name, value, options = {}) => {
3806
- console.log(`\u{1F680} ~ setCookieWeb:`, name, value, options);
3807
3806
  if (!isBrowser) return;
3808
3807
  const isLocalhost = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1";
3809
3808
  const optionsWithDefaults = {
@@ -3818,10 +3817,8 @@ var init_cookies = __esm({
3818
3817
  Date.now() + (optionsWithDefaults.days || 7) * 864e5
3819
3818
  ).toUTCString();
3820
3819
  const cookieString = name + "=" + encodeURIComponent(value) + "; expires=" + expires + stringifyOptions(optionsWithDefaults);
3821
- console.log(`\u{1F680} ~ Setting cookie:`, cookieString);
3822
3820
  document.cookie = cookieString;
3823
3821
  const wasSet = document.cookie.includes(name);
3824
- console.log(`\u{1F680} ~ Cookie ${name} was ${wasSet ? "SET \u2705" : "NOT SET \u274C"}`);
3825
3822
  };
3826
3823
  getCookieWeb = (name, initialValue = "") => {
3827
3824
  return isBrowser && document.cookie.split("; ").reduce((r, v) => {
@@ -23673,7 +23670,6 @@ function AuthProvider({
23673
23670
  const [wasGifted, setWasGifted] = (0, import_react20.useState)(false);
23674
23671
  const [session2, setSession] = (0, import_react20.useState)(props.session);
23675
23672
  const { searchParams, removeParams, pathname, addParams, ...router } = useNavigation();
23676
- console.log(`\u{1F680} ~ pathname from useNavigation:`, pathname);
23677
23673
  (0, import_react20.useEffect)(() => {
23678
23674
  if (error) {
23679
23675
  import_react_hot_toast.default.error(error);
@@ -23957,6 +23953,7 @@ function AuthProvider({
23957
23953
  }
23958
23954
  });
23959
23955
  const threadId = getThreadId(pathname);
23956
+ const threadIdRef = (0, import_react20.useRef)(threadId);
23960
23957
  const [app, setAppInternal] = (0, import_react20.useState)(props.app || session2?.app || baseApp);
23961
23958
  (0, import_react20.useEffect)(() => {
23962
23959
  const signInParam = searchParams.get("signIn");
@@ -24329,6 +24326,7 @@ function AuthProvider({
24329
24326
  );
24330
24327
  const setThread = (thread3) => {
24331
24328
  setThreadInternal(thread3);
24329
+ threadIdRef.current = thread3?.id;
24332
24330
  };
24333
24331
  const [tasks, setTasks] = (0, import_react20.useState)(void 0);
24334
24332
  (0, import_react20.useEffect)(() => {
@@ -24563,6 +24561,7 @@ function AuthProvider({
24563
24561
  userBaseApp,
24564
24562
  guestBaseApp,
24565
24563
  hasStoreApps,
24564
+ threadIdRef,
24566
24565
  vex: vex2,
24567
24566
  fetchApps: async () => {
24568
24567
  await refetchApps();
@@ -24732,7 +24731,7 @@ function DataProvider({ children, ...rest }) {
24732
24731
  const [instructions, setInstructions] = (0, import_react21.useState)([]);
24733
24732
  const [affiliateStats, setAffiliateStats] = (0, import_react21.useState)(null);
24734
24733
  const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react21.useState)(false);
24735
- const VERSION4 = "1.6.82";
24734
+ const VERSION4 = "1.6.83";
24736
24735
  const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
24737
24736
  const {
24738
24737
  API_URL: API_URL2,
@@ -26495,7 +26494,7 @@ function ChatProvider({
26495
26494
  perplexityAgent,
26496
26495
  claudeAgent,
26497
26496
  favouriteAgent,
26498
- threadId,
26497
+ threadIdRef,
26499
26498
  migratedFromGuestRef,
26500
26499
  fetchSession,
26501
26500
  loadingApp,
@@ -26507,6 +26506,7 @@ function ChatProvider({
26507
26506
  setHasNotification,
26508
26507
  ...auth
26509
26508
  } = useAuth();
26509
+ const threadId = threadIdRef.current;
26510
26510
  const [isChatFloating, setIsChatFloating] = (0, import_react29.useState)(false);
26511
26511
  const [input, setInput] = (0, import_react29.useState)("");
26512
26512
  const [messages, setMessages] = (0, import_react29.useState)(auth.threadData?.messages.messages || []);