@chrryai/chrry 1.7.19 → 1.7.22
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 +21 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -628,12 +628,12 @@ function getSiteConfig(hostnameOrMode) {
|
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
630
|
const mode = detectSiteMode(hostname2);
|
|
631
|
-
if (mode === "search") {
|
|
632
|
-
return search;
|
|
633
|
-
}
|
|
634
631
|
if (isE2E) {
|
|
635
632
|
return e2eVex;
|
|
636
633
|
}
|
|
634
|
+
if (mode === "search") {
|
|
635
|
+
return search;
|
|
636
|
+
}
|
|
637
637
|
if (hostname2 && matchesDomain(hostname2, "e2e.chrry.ai")) {
|
|
638
638
|
return e2eVex;
|
|
639
639
|
}
|
|
@@ -3262,7 +3262,7 @@ var init_utils = __esm({
|
|
|
3262
3262
|
};
|
|
3263
3263
|
isFirefox = typeof navigator !== "undefined" && navigator?.userAgent?.includes("Firefox");
|
|
3264
3264
|
config = getSiteConfig(getClientHostname2());
|
|
3265
|
-
VERSION = config.version || "1.7.
|
|
3265
|
+
VERSION = config.version || "1.7.22";
|
|
3266
3266
|
getSlugFromPathname = (path) => {
|
|
3267
3267
|
return getAppAndStoreSlugs(path, {
|
|
3268
3268
|
defaultAppSlug: config.slug,
|
|
@@ -24013,7 +24013,6 @@ function AuthProvider({
|
|
|
24013
24013
|
const [userBaseApp, setUserBaseApp] = (0, import_react20.useState)(
|
|
24014
24014
|
session2?.userBaseApp
|
|
24015
24015
|
);
|
|
24016
|
-
console.log(`\u{1F680} ~ userBaseApp:`, userBaseApp);
|
|
24017
24016
|
const userBaseStore = userBaseApp?.store;
|
|
24018
24017
|
const [guestBaseApp, setGuestBaseApp] = (0, import_react20.useState)(
|
|
24019
24018
|
session2?.guestBaseApp
|
|
@@ -24824,7 +24823,7 @@ function DataProvider({ children, ...rest }) {
|
|
|
24824
24823
|
const [instructions, setInstructions] = (0, import_react21.useState)([]);
|
|
24825
24824
|
const [affiliateStats, setAffiliateStats] = (0, import_react21.useState)(null);
|
|
24826
24825
|
const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react21.useState)(false);
|
|
24827
|
-
const VERSION4 = "1.7.
|
|
24826
|
+
const VERSION4 = "1.7.22";
|
|
24828
24827
|
const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
|
|
24829
24828
|
const {
|
|
24830
24829
|
API_URL: API_URL2,
|
|
@@ -24846,14 +24845,17 @@ function DataProvider({ children, ...rest }) {
|
|
|
24846
24845
|
error,
|
|
24847
24846
|
mutate: refetchWeather
|
|
24848
24847
|
} = (0, import_swr2.default)(
|
|
24849
|
-
|
|
24848
|
+
token && deviceId ? ["weather"] : null,
|
|
24850
24849
|
async () => {
|
|
24851
24850
|
if (!token) return null;
|
|
24852
24851
|
try {
|
|
24853
24852
|
const res = await apiFetch(`${API_URL2}/weather`, {
|
|
24854
24853
|
headers: { Authorization: `Bearer ${token}` }
|
|
24855
24854
|
});
|
|
24856
|
-
if (!res.ok)
|
|
24855
|
+
if (!res.ok) {
|
|
24856
|
+
console.error(`Error fetching weather`, res);
|
|
24857
|
+
return null;
|
|
24858
|
+
}
|
|
24857
24859
|
return res.json();
|
|
24858
24860
|
} catch (error2) {
|
|
24859
24861
|
captureException(error2);
|
|
@@ -25193,7 +25195,6 @@ var init_toast = __esm({
|
|
|
25193
25195
|
function useCookieOrLocalStorage(key, initialValue, canReadCookie = false) {
|
|
25194
25196
|
const { isExtension: isExtension2, isNative: isNative2 } = usePlatform();
|
|
25195
25197
|
const isWeb2 = !isExtension2 && !isNative2;
|
|
25196
|
-
console.log(`\u{1F680} ~ isWeb:`, isWeb2);
|
|
25197
25198
|
const [cookie, setCookieInternal] = useCookie(key, initialValue);
|
|
25198
25199
|
const [local, setLocalInternal] = useLocalStorage(
|
|
25199
25200
|
key,
|
|
@@ -31534,18 +31535,23 @@ function Weather({
|
|
|
31534
31535
|
const { utilities } = useStyles();
|
|
31535
31536
|
const { user, guest, token, setUser, setGuest, API_URL: API_URL2 } = useAuth();
|
|
31536
31537
|
const [isLoading, setIsLoading] = (0, import_react41.useState)(false);
|
|
31537
|
-
|
|
31538
|
+
const userOrGuestCountry = (user || guest)?.country || "";
|
|
31539
|
+
const userOrGuestCity = (user || guest)?.city || "";
|
|
31540
|
+
async function callApi(value = userOrGuestCity) {
|
|
31538
31541
|
if (!token) {
|
|
31539
31542
|
console.warn("Token not ready yet");
|
|
31540
31543
|
return [];
|
|
31541
31544
|
}
|
|
31542
31545
|
setIsLoading(true);
|
|
31543
|
-
const data = await apiFetch(
|
|
31544
|
-
|
|
31545
|
-
|
|
31546
|
-
|
|
31546
|
+
const data = await apiFetch(
|
|
31547
|
+
`${API_URL2}/cities?search=${value}&country=${getCountryCode(userOrGuestCountry)}`,
|
|
31548
|
+
{
|
|
31549
|
+
headers: {
|
|
31550
|
+
"Content-Type": "application/json",
|
|
31551
|
+
Authorization: `Bearer ${token}`
|
|
31552
|
+
}
|
|
31547
31553
|
}
|
|
31548
|
-
|
|
31554
|
+
).then((response) => response.json()).then((response) => {
|
|
31549
31555
|
return response.map((data2) => ({
|
|
31550
31556
|
value: data2.name,
|
|
31551
31557
|
country: data2.country,
|