@microsoft/omnichannel-chat-widget 1.0.5-main.b47afe8 → 1.0.5-main.b771061

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.
@@ -56,7 +56,7 @@ const prepareEndChat = async (props, chatSDK, state, dispatch, setAdapter, setWe
56
56
 
57
57
  // Initiate post chat render
58
58
  if (state !== null && state !== void 0 && (_state$domainStates2 = state.domainStates) !== null && _state$domainStates2 !== void 0 && _state$domainStates2.postChatContext) {
59
- await (0, _renderSurveyHelpers.initiatePostChat)(props, conversationDetails, state, dispatch);
59
+ await (0, _renderSurveyHelpers.initiatePostChat)(props, conversationDetails, state, dispatch, postchatContext);
60
60
  return;
61
61
  }
62
62
  } catch (error) {
@@ -87,10 +87,11 @@ const embedModePostChatWorkflow = async (state, dispatch) => {
87
87
  };
88
88
 
89
89
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
90
- const initiatePostChat = async (props, conversationDetailsParam, state, dispatch) => {
90
+ const initiatePostChat = async (props, conversationDetailsParam, state, dispatch, postchatContext) => {
91
91
  var _conversationDetails;
92
92
  conversationDetails = conversationDetailsParam;
93
- await setSurveyMode(props, (_conversationDetails = conversationDetails) === null || _conversationDetails === void 0 ? void 0 : _conversationDetails.participantType, state, dispatch);
93
+ const participantType = ((_conversationDetails = conversationDetails) === null || _conversationDetails === void 0 ? void 0 : _conversationDetails.participantType) ?? postchatContext.participantType;
94
+ await setSurveyMode(props, participantType, state, dispatch);
94
95
  await renderSurvey(state, dispatch);
95
96
  };
96
97
 
@@ -51,7 +51,7 @@ const prepareEndChat = async (props, chatSDK, state, dispatch, setAdapter, setWe
51
51
 
52
52
  // Initiate post chat render
53
53
  if (state !== null && state !== void 0 && (_state$domainStates2 = state.domainStates) !== null && _state$domainStates2 !== void 0 && _state$domainStates2.postChatContext) {
54
- await initiatePostChat(props, conversationDetails, state, dispatch);
54
+ await initiatePostChat(props, conversationDetails, state, dispatch, postchatContext);
55
55
  return;
56
56
  }
57
57
  } catch (error) {
@@ -81,10 +81,11 @@ const embedModePostChatWorkflow = async (state, dispatch) => {
81
81
  };
82
82
 
83
83
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
84
- const initiatePostChat = async (props, conversationDetailsParam, state, dispatch) => {
84
+ const initiatePostChat = async (props, conversationDetailsParam, state, dispatch, postchatContext) => {
85
85
  var _conversationDetails;
86
86
  conversationDetails = conversationDetailsParam;
87
- await setSurveyMode(props, (_conversationDetails = conversationDetails) === null || _conversationDetails === void 0 ? void 0 : _conversationDetails.participantType, state, dispatch);
87
+ const participantType = ((_conversationDetails = conversationDetails) === null || _conversationDetails === void 0 ? void 0 : _conversationDetails.participantType) ?? postchatContext.participantType;
88
+ await setSurveyMode(props, participantType, state, dispatch);
88
89
  await renderSurvey(state, dispatch);
89
90
  };
90
91
 
@@ -2,7 +2,7 @@ import { Dispatch } from "react";
2
2
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
3
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
4
4
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
- declare const initiatePostChat: (props: ILiveChatWidgetProps, conversationDetailsParam: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<void>;
5
+ declare const initiatePostChat: (props: ILiveChatWidgetProps, conversationDetailsParam: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, postchatContext: any) => Promise<void>;
6
6
  declare const isPostChatEnabled: (props: ILiveChatWidgetProps, state: ILiveChatWidgetContext) => boolean;
7
7
  declare const getPostChatContext: (chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<void>;
8
8
  declare const setWidgetStateToInactive: (dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "1.0.5-main.b47afe8",
3
+ "version": "1.0.5-main.b771061",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",