chat4app-client-angular 1.0.10 → 1.0.11

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.
@@ -1788,17 +1788,28 @@
1788
1788
  this.debug = chat4AppConfig.debug;
1789
1789
  };
1790
1790
  Chat4appClientAngularService.prototype.init = function (securityChatToken, callback, chatCallback, connectionClientId) {
1791
- if (!this.chatServer || this.chatServer.trim().length == 0) {
1792
- throw new Error("Endpoint is empty");
1793
- }
1794
- if (!securityChatToken || securityChatToken.trim().length == 0) {
1795
- throw new Error("SecurityChatToken is empty");
1796
- }
1797
- this.setTokenChat4app(securityChatToken);
1798
- if (chatCallback && connectionClientId) {
1799
- this.connectWebsocket(chatCallback, connectionClientId);
1800
- }
1801
- callback(securityChatToken);
1791
+ return __awaiter(this, void 0, void 0, function () {
1792
+ return __generator(this, function (_b) {
1793
+ switch (_b.label) {
1794
+ case 0:
1795
+ if (!this.chatServer || this.chatServer.trim().length == 0) {
1796
+ throw new Error("Endpoint is empty");
1797
+ }
1798
+ if (!securityChatToken || securityChatToken.trim().length == 0) {
1799
+ throw new Error("SecurityChatToken is empty");
1800
+ }
1801
+ this.setTokenChat4app(securityChatToken);
1802
+ if (!(chatCallback && connectionClientId)) return [3 /*break*/, 2];
1803
+ return [4 /*yield*/, this.connectWebsocket(chatCallback, connectionClientId)];
1804
+ case 1:
1805
+ _b.sent();
1806
+ _b.label = 2;
1807
+ case 2:
1808
+ callback(securityChatToken);
1809
+ return [2 /*return*/];
1810
+ }
1811
+ });
1812
+ });
1802
1813
  };
1803
1814
  Chat4appClientAngularService.prototype.getChatUrlDownload = function (messageFileId) {
1804
1815
  return this.chatUrl + "chatmessage/getFile?messageFileId=" + messageFileId + "&token=" + this.getBearerToken();