@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.esm.js +11 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +11 -8
- package/dist/index.js.map +1 -1
- package/dist/ui/help-popup.d.ts +1 -0
- package/package.json +1 -1
- package/src/ui/help-center.tsx +12 -9
- package/src/ui/help-popup.tsx +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -40246,20 +40246,23 @@ var HelpCenterContent = _ref => {
|
|
|
40246
40246
|
var _ref2 = _asyncToGenerator(function* (options) {
|
|
40247
40247
|
if (!sessionId || !selectedOption) return;
|
|
40248
40248
|
var fromChatScreen = (options === null || options === void 0 ? void 0 : options.fromChatScreen) === true;
|
|
40249
|
+
// When Ably sends end_session (e.g. admin closed from dashboard), skip close API call
|
|
40250
|
+
var sessionClosedByServer = (options === null || options === void 0 ? void 0 : options.sessionClosedByServer) === true;
|
|
40249
40251
|
try {
|
|
40250
40252
|
yield ClientAblyService.stopConnection();
|
|
40251
40253
|
setIsAblyConnected(false);
|
|
40252
40254
|
setAssistantStatus('idle');
|
|
40253
|
-
|
|
40254
|
-
|
|
40255
|
-
|
|
40256
|
-
|
|
40255
|
+
if (!sessionClosedByServer) {
|
|
40256
|
+
var response = yield apiRequest("Client/ClientChatSession/".concat(sessionId, "/close"), 'POST', null, {
|
|
40257
|
+
language: language
|
|
40258
|
+
});
|
|
40259
|
+
if (!response.ok) throw new Error('Failed to close chat session');
|
|
40260
|
+
}
|
|
40257
40261
|
setReviewSessionId(sessionId);
|
|
40258
40262
|
setSessionId(null);
|
|
40259
40263
|
if (fromChatScreen) {
|
|
40260
40264
|
setInChatReviewSessionId(sessionId);
|
|
40261
40265
|
setIsChatClosed(true);
|
|
40262
|
-
// Keep selectedOption and messages; do not open popup
|
|
40263
40266
|
} else {
|
|
40264
40267
|
setSelectedOption(null);
|
|
40265
40268
|
setMessages([]);
|
|
@@ -40463,10 +40466,11 @@ var HelpCenterContent = _ref => {
|
|
|
40463
40466
|
actionHandler.registerHandler('needs_agent', () => {
|
|
40464
40467
|
setNeedsAgent(true);
|
|
40465
40468
|
});
|
|
40466
|
-
// "end_session" →
|
|
40469
|
+
// "end_session" → session was closed by server (e.g. admin from dashboard); update local state only, do not call close API
|
|
40467
40470
|
actionHandler.registerHandler('end_session', () => {
|
|
40468
40471
|
void handleEndChat({
|
|
40469
|
-
fromChatScreen: true
|
|
40472
|
+
fromChatScreen: true,
|
|
40473
|
+
sessionClosedByServer: true
|
|
40470
40474
|
});
|
|
40471
40475
|
});
|
|
40472
40476
|
return () => {
|
|
@@ -40493,7 +40497,6 @@ var HelpCenterContent = _ref => {
|
|
|
40493
40497
|
return jsxs("div", {
|
|
40494
40498
|
className: 'babylai-theme-root babylai:mb-4',
|
|
40495
40499
|
style: themeStyles,
|
|
40496
|
-
dir: "auto",
|
|
40497
40500
|
children: [showArrowAnimation && !isOpen && !isClosing && jsx(FloatingMessage, {
|
|
40498
40501
|
onClose: handleCloseArrowAnimation,
|
|
40499
40502
|
message: messageLabel || t('homeSdk.needAssistance')
|