@microsoft/omnichannel-chat-widget 1.7.3-main.aa696dc → 1.7.3-main.fee24eb

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.
@@ -209,6 +209,7 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, state, props, params
209
209
  isStartChatSuccessful = false;
210
210
  throw error;
211
211
  }
212
+ await createAdapterAndSubscribe(chatSDK, dispatch, setAdapter);
212
213
 
213
214
  // Set app state to Active
214
215
  if (isStartChatSuccessful) {
@@ -233,12 +234,12 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, state, props, params
233
234
  (0, _setPostChatContextAndLoadSurvey.setPostChatContextAndLoadSurvey)(chatSDK, dispatch, true);
234
235
  return;
235
236
  }
236
- await createAdapterAndSubscribe(chatSDK, dispatch, setAdapter);
237
237
 
238
238
  // Persistent Chat relies on the `reconnectId` retrieved from reconnectablechats API to reconnect upon start chat and not `liveChatContext`
239
239
  if (!persistentChatEnabled) {
240
240
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
241
241
  const liveChatContext = await (chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.getCurrentLiveChatContext());
242
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
242
243
  dispatch({
243
244
  type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
244
245
  payload: liveChatContext
@@ -264,9 +265,7 @@ const createAdapterAndSubscribe = async (chatSDK, dispatch, setAdapter) => {
264
265
  // New adapter creation
265
266
  const newAdapter = await (0, _createAdapter.createAdapter)(chatSDK);
266
267
  setAdapter(newAdapter);
267
-
268
- //start chat is already seeding the chat token, so no need to get it again
269
- const chatToken = await chatSDK.getChatToken(true);
268
+ const chatToken = await chatSDK.getChatToken();
270
269
  dispatch({
271
270
  type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_TOKEN,
272
271
  payload: chatToken
@@ -202,6 +202,7 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, state, props, params
202
202
  isStartChatSuccessful = false;
203
203
  throw error;
204
204
  }
205
+ await createAdapterAndSubscribe(chatSDK, dispatch, setAdapter);
205
206
 
206
207
  // Set app state to Active
207
208
  if (isStartChatSuccessful) {
@@ -226,12 +227,12 @@ const initStartChat = async (chatSDK, dispatch, setAdapter, state, props, params
226
227
  setPostChatContextAndLoadSurvey(chatSDK, dispatch, true);
227
228
  return;
228
229
  }
229
- await createAdapterAndSubscribe(chatSDK, dispatch, setAdapter);
230
230
 
231
231
  // Persistent Chat relies on the `reconnectId` retrieved from reconnectablechats API to reconnect upon start chat and not `liveChatContext`
232
232
  if (!persistentChatEnabled) {
233
233
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
234
234
  const liveChatContext = await (chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.getCurrentLiveChatContext());
235
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
235
236
  dispatch({
236
237
  type: LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
237
238
  payload: liveChatContext
@@ -256,9 +257,7 @@ const createAdapterAndSubscribe = async (chatSDK, dispatch, setAdapter) => {
256
257
  // New adapter creation
257
258
  const newAdapter = await createAdapter(chatSDK);
258
259
  setAdapter(newAdapter);
259
-
260
- //start chat is already seeding the chat token, so no need to get it again
261
- const chatToken = await chatSDK.getChatToken(true);
260
+ const chatToken = await chatSDK.getChatToken();
262
261
  dispatch({
263
262
  type: LiveChatWidgetActionType.SET_CHAT_TOKEN,
264
263
  payload: chatToken
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "1.7.3-main.aa696dc",
3
+ "version": "1.7.3-main.fee24eb",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",