impact-chatbot 2.3.1 → 2.3.2

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.cjs.js CHANGED
@@ -9310,7 +9310,7 @@ const SmartBot = (props) => {
9310
9310
  React.useState(false);
9311
9311
  React.useState(false);
9312
9312
  const [conversation, setConversation] = React.useState({});
9313
- const chatbotContext = reactRedux.useSelector((state) => state.smartBotReducer.chatbotContext);
9313
+ const { chatbotContext, currentAgentChatId } = reactRedux.useSelector((state) => state.smartBotReducer);
9314
9314
  const activeTab = React.useRef({
9315
9315
  activeTab: "dashboard",
9316
9316
  });
@@ -9425,13 +9425,22 @@ const SmartBot = (props) => {
9425
9425
  }
9426
9426
  const [response, responseStore] = await Promise.all([
9427
9427
  fetchChatbotFilterConfig("product"),
9428
- fetchChatbotFilterConfig("store")
9428
+ fetchChatbotFilterConfig("store"),
9429
9429
  ]);
9430
9430
  const combinedOptions = [
9431
9431
  ...(response?.data?.data || []),
9432
9432
  ...(responseStore?.data?.data || []),
9433
- ...(chatbotFilterCustomConfig?.data || []) // Add custom filter config for testing
9433
+ ...(chatbotFilterCustomConfig?.data || []), // Add custom filter config for testing
9434
9434
  ];
9435
+ // Create hierarchy key-value pairs object
9436
+ const hierarchyKeyValuePairs = {};
9437
+ combinedOptions.forEach((option) => {
9438
+ if (option.column_name && option.label) {
9439
+ hierarchyKeyValuePairs[option.column_name] = option.label;
9440
+ }
9441
+ });
9442
+ // Dispatch hierarchy key-value pairs to store
9443
+ dispatch(smartBotActions.setHierarchyKeyValue(hierarchyKeyValuePairs));
9435
9444
  setFilterOptions(combinedOptions);
9436
9445
  }
9437
9446
  catch (error) {
@@ -9712,6 +9721,7 @@ const SmartBot = (props) => {
9712
9721
  setSessionId: setSessionId,
9713
9722
  setInitValue: setInitValue,
9714
9723
  uniqueChatId: uniqueChatId,
9724
+ currentAgentChatId: currentAgentChatId
9715
9725
  });
9716
9726
  setUserInput("");
9717
9727
  }
@@ -9878,6 +9888,7 @@ const SmartBot = (props) => {
9878
9888
  setUserInput("");
9879
9889
  setUniqueChatId("");
9880
9890
  chatDataRef.current[currentMode] = [];
9891
+ dispatch(smartBotActions.setCurrentAgentChatId(""));
9881
9892
  functionsState?.abortStreaming();
9882
9893
  return {
9883
9894
  tabName: currentMode,