@chrryai/chrry 1.2.8 → 1.2.10

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
@@ -1371,7 +1371,7 @@ declare const isFirefox: boolean;
1371
1371
  declare function getFlag({ code }: {
1372
1372
  code?: string;
1373
1373
  }): string;
1374
- declare const VERSION = "1.2.8";
1374
+ declare const VERSION = "1.2.10";
1375
1375
  type instructionBase = {
1376
1376
  id: string;
1377
1377
  title: string;
package/dist/index.d.ts CHANGED
@@ -1371,7 +1371,7 @@ declare const isFirefox: boolean;
1371
1371
  declare function getFlag({ code }: {
1372
1372
  code?: string;
1373
1373
  }): string;
1374
- declare const VERSION = "1.2.8";
1374
+ declare const VERSION = "1.2.10";
1375
1375
  type instructionBase = {
1376
1376
  id: string;
1377
1377
  title: string;
package/dist/index.js CHANGED
@@ -16624,12 +16624,11 @@ function AuthProvider({
16624
16624
  });
16625
16625
  };
16626
16626
  const isLiveTest = isGuestTest || isMemberTest;
16627
- const getAppSlug = (targetApp, debug = false) => {
16628
- debug && console.log(`\u{1F680} ~ file: AuthProvider.tsx:452 ~ targetApp:`, targetApp);
16629
- if (!targetApp) return "/";
16630
- if (targetApp.id === baseApp?.id) return "/";
16627
+ const getAppSlug = (targetApp, defaultSlug = "/") => {
16628
+ if (!targetApp) return defaultSlug;
16629
+ if (targetApp.id === baseApp?.id) return defaultSlug;
16631
16630
  if (baseApp?.id === chrry?.id && targetApp.id === chrry?.id) {
16632
- return `/`;
16631
+ return defaultSlug;
16633
16632
  }
16634
16633
  if (targetApp.id === chrry?.id || baseApp?.store?.apps.some((app2) => app2.id === targetApp.id)) {
16635
16634
  return `/${targetApp.slug}`;
@@ -17246,7 +17245,7 @@ function DataProvider({
17246
17245
  const [instructions, setInstructions] = (0, import_react14.useState)([]);
17247
17246
  const [affiliateStats, setAffiliateStats] = (0, import_react14.useState)(null);
17248
17247
  const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react14.useState)(false);
17249
- const VERSION3 = "1.2.8";
17248
+ const VERSION3 = "1.2.10";
17250
17249
  const [weather, setWeather] = useLocalStorage("weather", user?.weather || guest?.weather || void 0);
17251
17250
  const {
17252
17251
  API_URL: API_URL2,
@@ -18221,7 +18220,7 @@ var init_utils = __esm({
18221
18220
  window.history.replaceState({}, "", newUrl);
18222
18221
  };
18223
18222
  isFirefox = typeof navigator !== "undefined" && navigator?.userAgent.includes("Firefox");
18224
- VERSION = "1.2.8";
18223
+ VERSION = "1.2.10";
18225
18224
  getSlugFromPathname = (path) => {
18226
18225
  const siteConfig = getSiteConfig();
18227
18226
  const defaultValues = {
@@ -30101,7 +30100,7 @@ function Menu({
30101
30100
  showThreads = true
30102
30101
  }) {
30103
30102
  const { t: t5 } = useAppContext();
30104
- const { user, guest, profile, track, language } = useAuth();
30103
+ const { user, guest, profile, track, language, allApps, getAppSlug } = useAuth();
30105
30104
  const {
30106
30105
  router,
30107
30106
  threads,
@@ -30351,7 +30350,7 @@ function Menu({
30351
30350
  ), /* @__PURE__ */ import_react55.default.createElement(
30352
30351
  "a",
30353
30352
  {
30354
- href: isStandalone2 ? void 0 : `${FRONTEND_URL}/threads`,
30353
+ href: isStandalone2 ? void 0 : `${app ? getAppSlug(app, "") : ""}/threads`,
30355
30354
  onClick: (e) => {
30356
30355
  track({
30357
30356
  name: "threads-click-menu"
@@ -30536,28 +30535,32 @@ function Menu({
30536
30535
  }
30537
30536
  ) : thread2.visibility === "public" ? /* @__PURE__ */ import_react55.default.createElement(icons_exports.LockOpen, { color: "var(--accent-1)", size: 13 }) : thread2.visibility === "protected" ? /* @__PURE__ */ import_react55.default.createElement(icons_exports.UserLock, { color: "var(--accent-1)", size: 13 }) : null
30538
30537
  ) : null,
30539
- /* @__PURE__ */ import_react55.default.createElement(
30540
- "a",
30541
- {
30542
- "data-testid": `thread-link-${thread2.id}`,
30543
- onClick: (e) => {
30544
- track({
30545
- name: "thread-click-menu",
30546
- props: {
30547
- threadId: thread2.id
30538
+ (() => {
30539
+ const threadApp = thread2.appId ? allApps.find((app2) => app2.id === thread2.appId) : void 0;
30540
+ const url = threadApp ? `${getAppSlug(threadApp, "")}/threads/${thread2.id}` : `/threads/${thread2.id}`;
30541
+ return /* @__PURE__ */ import_react55.default.createElement(
30542
+ "a",
30543
+ {
30544
+ "data-testid": `thread-link-${thread2.id}`,
30545
+ onClick: (e) => {
30546
+ track({
30547
+ name: "thread-click-menu",
30548
+ props: {
30549
+ threadId: thread2.id
30550
+ }
30551
+ });
30552
+ if (e.metaKey || e.ctrlKey) {
30553
+ return;
30548
30554
  }
30549
- });
30550
- if (e.metaKey || e.ctrlKey) {
30551
- return;
30552
- }
30553
- e.preventDefault();
30554
- isSmallDevice ? toggleMenu() : addHapticFeedback();
30555
- router.push(`/threads/${thread2.id}`);
30555
+ e.preventDefault();
30556
+ isSmallDevice ? toggleMenu() : addHapticFeedback();
30557
+ router.push(url);
30558
+ },
30559
+ href: url
30556
30560
  },
30557
- href: `/threads/${thread2.id}`
30558
- },
30559
- thread2.title
30560
- ),
30561
+ thread2.title
30562
+ );
30563
+ })(),
30561
30564
  collaborationStatus === "pending" ? /* @__PURE__ */ import_react55.default.createElement(
30562
30565
  CollaborationStatus,
30563
30566
  {