@microsoft/omnichannel-chat-sdk
Advanced tools
Comparing version 1.10.12-main.80b8fd0 to 1.10.12
@@ -20,3 +20,5 @@ import { AzureCommunicationTokenCredential } from "@azure/communication-common"; | ||
private eventListeners; | ||
private conversationEnded; | ||
constructor(tokenCredential: AzureCommunicationTokenCredential, chatClient: ChatClient, logger?: ACSClientLogger | null); | ||
stopPolling(): Promise<void>; | ||
initialize(sessionInfo: ACSSessionInfo): Promise<void>; | ||
@@ -23,0 +25,0 @@ getMessages(optionsParams?: ACSGetMessagesOptionalParams): Promise<OmnichannelMessage[] | ChatMessage[]>; |
@@ -97,2 +97,3 @@ "use strict"; | ||
this.logger = null; | ||
this.conversationEnded = false; | ||
this.logger = logger; | ||
@@ -103,2 +104,10 @@ this.tokenCredential = tokenCredential; | ||
} | ||
ACSConversation.prototype.stopPolling = function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
this.conversationEnded = true; | ||
return [2 /*return*/]; | ||
}); | ||
}); | ||
}; | ||
ACSConversation.prototype.initialize = function (sessionInfo) { | ||
@@ -258,3 +267,3 @@ return __awaiter(this, void 0, void 0, function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var isReceivingNotifications, postedMessageIds, pollForMessages_1, delayGenerator, listener, error_5, exceptionDetails; | ||
var postedMessageIds, pollForMessages_1, delayGenerator, listener, error_5, exceptionDetails; | ||
var _this = this; | ||
@@ -266,3 +275,2 @@ var _a, _b, _c, _d, _e; | ||
(_a = this.logger) === null || _a === void 0 ? void 0 : _a.startScenario(ACSClientEvent.RegisterOnNewMessage); | ||
isReceivingNotifications = false; | ||
postedMessageIds = new Set(); | ||
@@ -277,4 +285,3 @@ _f.label = 1; | ||
case 0: | ||
if (isReceivingNotifications) { | ||
console.log("Not receiving notifications, skipping polling"); | ||
if (this.conversationEnded === true) { | ||
return [2 /*return*/]; | ||
@@ -326,3 +333,2 @@ } | ||
var _a; | ||
isReceivingNotifications = true; | ||
var id = event.id, sender = event.sender; | ||
@@ -329,0 +335,0 @@ var customerMessageCondition = (sender.communicationUserId === ((_a = _this.sessionInfo) === null || _a === void 0 ? void 0 : _a.id)); |
{ | ||
"name": "@microsoft/omnichannel-chat-sdk", | ||
"version": "1.10.12-main.80b8fd0", | ||
"version": "1.10.12", | ||
"description": "Microsoft Omnichannel Chat SDK", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1090683
15235
0