@aslaluroba/help-center-react 3.2.11 → 3.2.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/index.js CHANGED
@@ -40266,20 +40266,23 @@ var HelpCenterContent = _ref => {
40266
40266
  var _ref2 = _asyncToGenerator(function* (options) {
40267
40267
  if (!sessionId || !selectedOption) return;
40268
40268
  var fromChatScreen = (options === null || options === void 0 ? void 0 : options.fromChatScreen) === true;
40269
+ // When Ably sends end_session (e.g. admin closed from dashboard), skip close API call
40270
+ var sessionClosedByServer = (options === null || options === void 0 ? void 0 : options.sessionClosedByServer) === true;
40269
40271
  try {
40270
40272
  yield ClientAblyService.stopConnection();
40271
40273
  setIsAblyConnected(false);
40272
40274
  setAssistantStatus('idle');
40273
- var response = yield apiRequest("Client/ClientChatSession/".concat(sessionId, "/close"), 'POST', null, {
40274
- language: language
40275
- });
40276
- if (!response.ok) throw new Error('Failed to close chat session');
40275
+ if (!sessionClosedByServer) {
40276
+ var response = yield apiRequest("Client/ClientChatSession/".concat(sessionId, "/close"), 'POST', null, {
40277
+ language: language
40278
+ });
40279
+ if (!response.ok) throw new Error('Failed to close chat session');
40280
+ }
40277
40281
  setReviewSessionId(sessionId);
40278
40282
  setSessionId(null);
40279
40283
  if (fromChatScreen) {
40280
40284
  setInChatReviewSessionId(sessionId);
40281
40285
  setIsChatClosed(true);
40282
- // Keep selectedOption and messages; do not open popup
40283
40286
  } else {
40284
40287
  setSelectedOption(null);
40285
40288
  setMessages([]);
@@ -40483,10 +40486,11 @@ var HelpCenterContent = _ref => {
40483
40486
  actionHandler.registerHandler('needs_agent', () => {
40484
40487
  setNeedsAgent(true);
40485
40488
  });
40486
- // "end_session" → close session and show in-chat review (user stays in chat)
40489
+ // "end_session" → session was closed by server (e.g. admin from dashboard); update local state only, do not call close API
40487
40490
  actionHandler.registerHandler('end_session', () => {
40488
40491
  void handleEndChat({
40489
- fromChatScreen: true
40492
+ fromChatScreen: true,
40493
+ sessionClosedByServer: true
40490
40494
  });
40491
40495
  });
40492
40496
  return () => {
@@ -40513,7 +40517,6 @@ var HelpCenterContent = _ref => {
40513
40517
  return jsxRuntime.jsxs("div", {
40514
40518
  className: 'babylai-theme-root babylai:mb-4',
40515
40519
  style: themeStyles,
40516
- dir: "auto",
40517
40520
  children: [showArrowAnimation && !isOpen && !isClosing && jsxRuntime.jsx(FloatingMessage, {
40518
40521
  onClose: handleCloseArrowAnimation,
40519
40522
  message: messageLabel || t('homeSdk.needAssistance')