@aslaluroba/help-center-react 3.2.12 → 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 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +11 -7
- 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 +11 -8
- package/src/ui/help-popup.tsx +1 -1
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
|
-
|
|
40274
|
-
|
|
40275
|
-
|
|
40276
|
-
|
|
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" →
|
|
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 () => {
|