vdb-ai-chat 1.0.11 → 1.0.13
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/chat-widget.js +1 -1
- package/lib/commonjs/api.js +3 -5
- package/lib/commonjs/api.js.map +1 -1
- package/lib/commonjs/components/ChatInput.js +1 -2
- package/lib/commonjs/components/ChatInput.js.map +1 -1
- package/lib/commonjs/components/ChatWidget.js +2 -2
- package/lib/commonjs/components/ChatWidget.js.map +1 -1
- package/lib/module/api.js +3 -5
- package/lib/module/api.js.map +1 -1
- package/lib/module/components/ChatInput.js +1 -2
- package/lib/module/components/ChatInput.js.map +1 -1
- package/lib/module/components/ChatWidget.js +2 -2
- package/lib/module/components/ChatWidget.js.map +1 -1
- package/lib/typescript/api.d.ts.map +1 -1
- package/lib/typescript/components/ChatInput.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api.ts +4 -10
- package/src/components/ChatInput.tsx +0 -1
- package/src/components/ChatWidget.tsx +2 -2
package/src/api.ts
CHANGED
|
@@ -211,10 +211,9 @@ export async function getProducts(
|
|
|
211
211
|
params: ChatApiParams,
|
|
212
212
|
priceMode: string | null
|
|
213
213
|
): Promise<any> {
|
|
214
|
+
const isLabgrown = (typeof params.lab_grown === "string" ? params.lab_grown === "true" : typeof params.lab_grown === "boolean" ? params.lab_grown : false);
|
|
214
215
|
const userInfo = await Storage.getJSON<UserDetails>("persist:userInfo", {});
|
|
215
|
-
const
|
|
216
|
-
(await Storage.getItem("persist:appState")) || "{}"
|
|
217
|
-
) as { activeProduct?: string };
|
|
216
|
+
const activeProduct = isLabgrown ? "lab_grown_diamond" : "diamond";
|
|
218
217
|
const searchResultViewTypeMap = JSON.parse(
|
|
219
218
|
userInfo?.searchResultViewType || "{}"
|
|
220
219
|
);
|
|
@@ -224,16 +223,11 @@ export async function getProducts(
|
|
|
224
223
|
(await Storage.getItem("persist:searchFilters")) || "{}"
|
|
225
224
|
);
|
|
226
225
|
|
|
227
|
-
const sectionName =
|
|
228
|
-
typeof rawState?.sectionName === "string"
|
|
229
|
-
? JSON.parse(rawState.sectionName)
|
|
230
|
-
: rawState?.sectionName;
|
|
231
|
-
|
|
232
226
|
const rootState = JSON.parse((await Storage.getItem("persist:root")) || "{}");
|
|
233
227
|
const selectedGroups =
|
|
234
228
|
typeof rootState?.selectedGroups === "string"
|
|
235
|
-
? JSON.parse(rootState.selectedGroups)
|
|
236
|
-
: rootState?.selectedGroups || {};
|
|
229
|
+
? JSON.parse(rootState.selectedGroups)?.selectedGroups
|
|
230
|
+
: rootState?.selectedGroups?.selectedGroups || {};
|
|
237
231
|
|
|
238
232
|
let mGroupIds = selectedGroups[activeProduct ?? ""];
|
|
239
233
|
let vdbSetting = false;
|
|
@@ -149,7 +149,7 @@ export const ChatWidget = forwardRef<ChatWidgetRef, ChatWidgetProps>(
|
|
|
149
149
|
delete searchPayload.three_x;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
const stringifiedSearchPayload = JSON.stringify(searchPayload);
|
|
153
153
|
const payload = item?.search_payload;
|
|
154
154
|
if (!payload) return;
|
|
155
155
|
const isLabgrown = (typeof payload.lab_grown === "string" ? payload.lab_grown === "true" : typeof payload.lab_grown === "boolean" ? payload.lab_grown : false);
|
|
@@ -160,7 +160,7 @@ export const ChatWidget = forwardRef<ChatWidgetRef, ChatWidgetProps>(
|
|
|
160
160
|
isLabgrown ? "lab_grown_diamond" : "diamond"
|
|
161
161
|
}&fromNewFilterScreen=false&filterSplitStep=1§ionName=${
|
|
162
162
|
searchPayload.pair === "pair" ? "Pairs" : "Single Stones"
|
|
163
|
-
}&breadCrumbLabel=Stone%20Search&enterSecondFlow=false&saved_search=${
|
|
163
|
+
}&breadCrumbLabel=Stone%20Search&enterSecondFlow=false&saved_search=${stringifiedSearchPayload}`;
|
|
164
164
|
|
|
165
165
|
if (onViewAllPress) {
|
|
166
166
|
onViewAllPress(deepLinkUrl, payload);
|