@chrryai/chrry 1.7.10 → 1.7.12

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
@@ -3175,7 +3175,7 @@ var init_utils = __esm({
3175
3175
  };
3176
3176
  isFirefox = typeof navigator !== "undefined" && navigator?.userAgent?.includes("Firefox");
3177
3177
  config = getSiteConfig(getClientHostname2());
3178
- VERSION = config.version || "1.7.10";
3178
+ VERSION = config.version || "1.7.12";
3179
3179
  getSlugFromPathname = (path) => {
3180
3180
  return getAppAndStoreSlugs(path, {
3181
3181
  defaultAppSlug: config.slug,
@@ -6183,7 +6183,7 @@ function useNavigation() {
6183
6183
  });
6184
6184
  const queryString = newSearchParams.toString();
6185
6185
  const newUrl = queryString ? `${pathname}?${queryString}` : pathname;
6186
- clientRouter2.push(newUrl);
6186
+ clientRouter2.push(newUrl, { shallow: true });
6187
6187
  },
6188
6188
  [clientRouter2, pathname, searchParams]
6189
6189
  );
@@ -6191,10 +6191,14 @@ function useNavigation() {
6191
6191
  (keys) => {
6192
6192
  const newSearchParams = new URLSearchParams(searchParams?.toString());
6193
6193
  const keysArray = Array.isArray(keys) ? keys : [keys];
6194
+ const hasAnyKey = keysArray.some((key) => newSearchParams.has(key));
6195
+ if (!hasAnyKey) {
6196
+ return;
6197
+ }
6194
6198
  keysArray.forEach((key) => newSearchParams.delete(key));
6195
6199
  const queryString = newSearchParams.toString();
6196
6200
  const newUrl = queryString ? `${pathname}?${queryString}` : pathname;
6197
- clientRouter2.push(newUrl);
6201
+ clientRouter2.push(newUrl, { shallow: true });
6198
6202
  },
6199
6203
  [clientRouter2, pathname, searchParams]
6200
6204
  );
@@ -6206,7 +6210,7 @@ function useNavigation() {
6206
6210
  });
6207
6211
  const queryString = newSearchParams.toString();
6208
6212
  const newUrl = queryString ? `${pathname}?${queryString}` : pathname;
6209
- clientRouter2.push(newUrl);
6213
+ clientRouter2.push(newUrl, { shallow: true });
6210
6214
  },
6211
6215
  [clientRouter2, pathname]
6212
6216
  );
@@ -24691,7 +24695,7 @@ function DataProvider({ children, ...rest }) {
24691
24695
  const [instructions, setInstructions] = (0, import_react21.useState)([]);
24692
24696
  const [affiliateStats, setAffiliateStats] = (0, import_react21.useState)(null);
24693
24697
  const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react21.useState)(false);
24694
- const VERSION4 = "1.7.10";
24698
+ const VERSION4 = "1.7.12";
24695
24699
  const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
24696
24700
  const {
24697
24701
  API_URL: API_URL2,
@@ -30224,7 +30228,7 @@ function Modal({
30224
30228
  const styles4 = useModalStyles();
30225
30229
  const { utilities } = useStyles();
30226
30230
  const { track } = useAuth();
30227
- const { addParams, removeParams } = useNavigation();
30231
+ const { addParams, removeParams, searchParams } = useNavigation();
30228
30232
  const { isDrawerOpen } = useTheme2();
30229
30233
  const innerRef = import_react39.default.useRef(null);
30230
30234
  const [isModalOpen, setIsModalOpen] = (0, import_react39.useState)(
@@ -38828,6 +38832,7 @@ function Chat({
38828
38832
  deps: webSocketDeps,
38829
38833
  onMessage: async ({ type, data }) => {
38830
38834
  const threadId2 = threadIdRef.current;
38835
+ data?.streamId && setStreamId(data.streamId);
38831
38836
  if (!token) return;
38832
38837
  const clientId2 = data?.clientId;
38833
38838
  if (data?.message && isOwner_default(data.message.message, {
@@ -38848,7 +38853,6 @@ function Chat({
38848
38853
  playNotification();
38849
38854
  isPlayingSillyPopCluster.current = true;
38850
38855
  }
38851
- data.streamId && setStreamId(data.streamId);
38852
38856
  if (shouldStopRef.current) return;
38853
38857
  if (!shouldStopRef.current) {
38854
38858
  streamContentRef.current += data.chunk;
@@ -38886,6 +38890,7 @@ function Chat({
38886
38890
  }
38887
38891
  }
38888
38892
  onStreamingComplete?.(data.message);
38893
+ data.streamId === streamId && setStreamId(null);
38889
38894
  if (message2?.message && isOwner_default(data.message.message, {
38890
38895
  userId: user?.id,
38891
38896
  guestId: guest?.id
@@ -38923,6 +38928,7 @@ function Chat({
38923
38928
  isImageGenerationEnabled: data?.isImageGenerationEnabled,
38924
38929
  isWebSearchEnabled: data?.isWebSearchEnabled
38925
38930
  });
38931
+ setIsStreaming(true);
38926
38932
  const requestHeaders = {
38927
38933
  "Content-Type": "application/json",
38928
38934
  Authorization: `Bearer ${token}`