@chrryai/chrry 1.7.43 → 1.7.45

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
@@ -3265,7 +3265,7 @@ var init_utils = __esm({
3265
3265
  };
3266
3266
  isFirefox = typeof navigator !== "undefined" && navigator?.userAgent?.includes("Firefox");
3267
3267
  config = getSiteConfig(getClientHostname2());
3268
- VERSION = config.version || "1.7.43";
3268
+ VERSION = config.version || "1.7.45";
3269
3269
  getSlugFromPathname = (path) => {
3270
3270
  return getAppAndStoreSlugs(path, {
3271
3271
  defaultAppSlug: config.slug,
@@ -24233,8 +24233,32 @@ function AuthProvider({
24233
24233
  if (storeAppsSwr) {
24234
24234
  storeAppsSwr.store?.apps?.find((app2) => app2.id === loadingAppId) && setLoadingApp(void 0);
24235
24235
  mergeApps(storeAppsSwr.store?.apps || []);
24236
+ const n = storeAppsSwr.store?.apps.find((app2) => app2.id === newApp?.id);
24237
+ if (n) {
24238
+ import_react_hot_toast.default.success((0, import_i18next2.t)("\u{1F973} WOW!, you created something amazing"));
24239
+ setNewApp(void 0);
24240
+ setBaseAccountApp(n);
24241
+ setIsSavingApp(false);
24242
+ setIsManagingApp(false);
24243
+ setApp(n);
24244
+ setStore(n.store);
24245
+ }
24246
+ const u = storeAppsSwr?.store?.apps.find(
24247
+ (app2) => app2.id === updatedApp?.id
24248
+ );
24249
+ if (u) {
24250
+ import_react_hot_toast.default.success((0, import_i18next2.t)("Updated") + " \u{1F680}");
24251
+ setUpdatedApp(void 0);
24252
+ setBaseAccountApp(u);
24253
+ setIsManagingApp(false);
24254
+ setIsSavingApp(false);
24255
+ setApp(u);
24256
+ setStore(u.store);
24257
+ setSlug(getAppSlug2(u) || "");
24258
+ return;
24259
+ }
24236
24260
  }
24237
- }, [storeAppsSwr]);
24261
+ }, [storeAppsSwr, newApp, updatedApp]);
24238
24262
  const canShowFocus = !!(focus2 && app && app?.id === focus2.id && !threadId);
24239
24263
  const [showFocus, setShowFocus] = (0, import_react20.useState)(canShowFocus);
24240
24264
  (0, import_react20.useEffect)(() => {
@@ -24446,30 +24470,6 @@ function AuthProvider({
24446
24470
  (0, import_react20.useEffect)(() => {
24447
24471
  if (!storeApps.length || !thread2 && threadId) return;
24448
24472
  let matchedApp;
24449
- const n = storeApps.find((app2) => app2.id === newApp?.id);
24450
- if (n) {
24451
- setNewApp(void 0);
24452
- setBaseAccountApp(n);
24453
- setIsSavingApp(false);
24454
- setIsManagingApp(false);
24455
- import_react_hot_toast.default.success((0, import_i18next2.t)("\u{1F973} WOW!, you created something amazing"));
24456
- setApp(n);
24457
- setStore(n.store);
24458
- setSlug(getAppSlug2(n) || "");
24459
- return;
24460
- }
24461
- const u = storeAppsSwr?.store?.apps.find((app2) => app2.id === updatedApp?.id);
24462
- if (u) {
24463
- setUpdatedApp(void 0);
24464
- setBaseAccountApp(u);
24465
- setIsManagingApp(false);
24466
- setIsSavingApp(false);
24467
- import_react_hot_toast.default.success((0, import_i18next2.t)("Updated") + " \u{1F680}");
24468
- setApp(u);
24469
- setStore(u.store);
24470
- setSlug(getAppSlug2(u) || "");
24471
- return;
24472
- }
24473
24473
  if (!matchedApp && thread2?.appId) {
24474
24474
  const threadApp = storeApps.find((app2) => app2.id === thread2.appId);
24475
24475
  matchedApp = threadApp;
@@ -24497,8 +24497,6 @@ function AuthProvider({
24497
24497
  setSlug(getAppSlug2(matchedApp) || "");
24498
24498
  }
24499
24499
  }, [
24500
- updatedApp,
24501
- newApp,
24502
24500
  storeApps,
24503
24501
  pathname,
24504
24502
  baseApp,
@@ -24507,8 +24505,7 @@ function AuthProvider({
24507
24505
  lastAppId,
24508
24506
  isExtension2,
24509
24507
  loadingAppId,
24510
- updatedApp,
24511
- newApp
24508
+ updatedApp
24512
24509
  ]);
24513
24510
  const [profile, setProfileInternal] = (0, import_react20.useState)(void 0);
24514
24511
  const setProfile = (profile2) => {
@@ -24859,7 +24856,7 @@ function DataProvider({ children, ...rest }) {
24859
24856
  const [instructions, setInstructions] = (0, import_react21.useState)([]);
24860
24857
  const [affiliateStats, setAffiliateStats] = (0, import_react21.useState)(null);
24861
24858
  const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react21.useState)(false);
24862
- const VERSION4 = "1.7.43";
24859
+ const VERSION4 = "1.7.45";
24863
24860
  const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
24864
24861
  const {
24865
24862
  API_URL: API_URL2,
@@ -25775,8 +25772,10 @@ function AppProvider({ children }) {
25775
25772
  clear("app");
25776
25773
  if (canEditApp) {
25777
25774
  setUpdatedApp(result);
25775
+ await fetchApps();
25778
25776
  } else {
25779
25777
  setNewApp(result);
25778
+ await fetchApps();
25780
25779
  }
25781
25780
  clearFormDraft();
25782
25781
  setAppStatus(void 0);
@@ -26025,8 +26024,6 @@ function AppProvider({ children }) {
26025
26024
  newSearchParams.set(key, String(value));
26026
26025
  });
26027
26026
  const slug2 = baseApp?.store?.slug;
26028
- const newUrl = `/${slug2 === chrry?.slug ? "" : slug2 ?? chrry?.slug}/${app?.slug}?${newSearchParams.toString()}`;
26029
- push(newUrl);
26030
26027
  } else {
26031
26028
  push("/");
26032
26029
  }