@chrryai/chrry 1.2.61 → 1.2.63

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.d.mts CHANGED
@@ -782,7 +782,7 @@ declare const isFirefox: boolean;
782
782
  declare function getFlag({ code }: {
783
783
  code?: string;
784
784
  }): string;
785
- declare const VERSION = "1.2.61";
785
+ declare const VERSION = "1.2.63";
786
786
  type instructionBase = {
787
787
  id: string;
788
788
  title: string;
package/dist/index.d.ts CHANGED
@@ -782,7 +782,7 @@ declare const isFirefox: boolean;
782
782
  declare function getFlag({ code }: {
783
783
  code?: string;
784
784
  }): string;
785
- declare const VERSION = "1.2.61";
785
+ declare const VERSION = "1.2.63";
786
786
  type instructionBase = {
787
787
  id: string;
788
788
  title: string;
package/dist/index.js CHANGED
@@ -20203,10 +20203,7 @@ function AuthProvider({
20203
20203
  }
20204
20204
  }
20205
20205
  );
20206
- let sessionData = session2 || sessionSwr;
20207
- if (sessionSwr) {
20208
- sessionData = sessionSwr;
20209
- }
20206
+ const sessionData = sessionSwr || session2;
20210
20207
  const [allApps, setAllApps] = (0, import_react12.useState)(
20211
20208
  sessionData?.apps || []
20212
20209
  );
@@ -20661,7 +20658,7 @@ function DataProvider({
20661
20658
  const [instructions, setInstructions] = (0, import_react14.useState)([]);
20662
20659
  const [affiliateStats, setAffiliateStats] = (0, import_react14.useState)(null);
20663
20660
  const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react14.useState)(false);
20664
- const VERSION3 = "1.2.61";
20661
+ const VERSION3 = "1.2.63";
20665
20662
  const [weather, setWeather] = useLocalStorage("weather", user?.weather || guest?.weather || void 0);
20666
20663
  const {
20667
20664
  API_URL: API_URL2,
@@ -21702,7 +21699,7 @@ var init_utils = __esm({
21702
21699
  window.history.replaceState({}, "", newUrl);
21703
21700
  };
21704
21701
  isFirefox = typeof navigator !== "undefined" && navigator?.userAgent.includes("Firefox");
21705
- VERSION = "1.2.61";
21702
+ VERSION = "1.2.63";
21706
21703
  getSlugFromPathname = (path) => {
21707
21704
  const siteConfig = getSiteConfig();
21708
21705
  return getAppAndStoreSlugs(path, {
@@ -36921,6 +36918,9 @@ function Store({
36921
36918
  const { router, setIsNewChat, pathname, searchParams } = useNavigationContext();
36922
36919
  const { allApps, getAppSlug, setApp, app } = useAuth();
36923
36920
  const [storeSlug, setStoreSlug] = (0, import_react66.useState)(pathname.replace("/", ""));
36921
+ (0, import_react66.useEffect)(() => {
36922
+ setStoreSlug(pathname.replace("/", ""));
36923
+ }, [pathname]);
36924
36924
  const matchedApp = allApps?.find((app2) => app2?.store?.slug === storeSlug);
36925
36925
  const store = matchedApp?.store;
36926
36926
  const apps = store?.apps;
@@ -39574,14 +39574,14 @@ var init_Thread = __esm({
39574
39574
  }, [shouldRefetchThread]);
39575
39575
  const [status, setStatus] = (0, import_react76.useState)(null);
39576
39576
  const { actions } = useData();
39577
- const [shouldFetchThread, setShouldFetchThread] = (0, import_react76.useState)(true);
39577
+ const [shouldFetchThread, setShouldFetchThread] = (0, import_react76.useState)(!thread2);
39578
39578
  const {
39579
39579
  data: threadSWR,
39580
39580
  mutate,
39581
39581
  error,
39582
39582
  isLoading: isLoadingThread
39583
39583
  } = (0, import_swr6.default)(
39584
- shouldFetchThread && !isHome && token && id ? ["thread", id, liked] : null,
39584
+ shouldFetchThread && !isHome && token && id ? ["thread", id, liked, until] : null,
39585
39585
  () => {
39586
39586
  if (!id || !token) return;
39587
39587
  return actions.getThread({
@@ -39598,11 +39598,19 @@ var init_Thread = __esm({
39598
39598
  // revalidateOnMount: true,
39599
39599
  }
39600
39600
  );
39601
+ (0, import_react76.useEffect)(() => {
39602
+ setShouldFetchThread(true);
39603
+ }, [router]);
39601
39604
  const refetch = () => {
39602
39605
  setShouldFetchThread(true);
39603
39606
  return mutate();
39604
39607
  };
39605
- const threadData = props.threadData || threadSWR || void 0;
39608
+ const threadData = threadSWR || props.threadData || void 0;
39609
+ console.log(
39610
+ `\u{1F680} ~ file: Thread.tsx:252 ~ threadSWR:`,
39611
+ threadSWR?.thread?.id,
39612
+ shouldFetchThread
39613
+ );
39606
39614
  (0, import_react76.useEffect)(() => {
39607
39615
  !isLoadingThread && setIsLoading(false);
39608
39616
  }, [isLoadingThread]);