chat4app-client-angular 1.0.12 → 1.0.14
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/bundles/chat4app-client-angular.umd.js +28 -20
- package/bundles/chat4app-client-angular.umd.js.map +1 -1
- package/bundles/chat4app-client-angular.umd.min.js +2 -2
- package/bundles/chat4app-client-angular.umd.min.js.map +1 -1
- package/esm2015/lib/chat4app-client-angular.service.js +11 -6
- package/fesm2015/chat4app-client-angular.js +10 -5
- package/fesm2015/chat4app-client-angular.js.map +1 -1
- package/lib/chat4app-client-angular.service.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('chat4app-client-angular', ['exports', '@angular/core', '@angular/common/http'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["chat4app-client-angular"] = {}, global.ng.core, global.ng.common.http));
|
|
5
|
-
})(this, (function (exports, i0, i1) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('rxjs')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('chat4app-client-angular', ['exports', '@angular/core', '@angular/common/http', 'rxjs'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["chat4app-client-angular"] = {}, global.ng.core, global.ng.common.http, global.rxjs));
|
|
5
|
+
})(this, (function (exports, i0, i1, rxjs) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -2287,8 +2287,7 @@
|
|
|
2287
2287
|
};
|
|
2288
2288
|
Chat4appClientAngularService.prototype.disconnectInternal = function (ignoreOffLine) {
|
|
2289
2289
|
return __awaiter(this, void 0, void 0, function () {
|
|
2290
|
-
var e_1;
|
|
2291
|
-
var _this = this;
|
|
2290
|
+
var e_1, e_2;
|
|
2292
2291
|
return __generator(this, function (_b) {
|
|
2293
2292
|
switch (_b.label) {
|
|
2294
2293
|
case 0:
|
|
@@ -2300,31 +2299,40 @@
|
|
|
2300
2299
|
catch (e) {
|
|
2301
2300
|
}
|
|
2302
2301
|
}
|
|
2303
|
-
if (!ignoreOffLine && this.nc && this.chatUserExternalId && this.chatUserExternalId.length > 0 && this.getBearerToken() && this.getBearerToken().length > 0)
|
|
2304
|
-
this.setOffLine(this.chatUserExternalId).subscribe(function () {
|
|
2305
|
-
if (_this.debug) {
|
|
2306
|
-
console.log("had set offline");
|
|
2307
|
-
}
|
|
2308
|
-
});
|
|
2309
|
-
}
|
|
2310
|
-
if (!this.nc) return [3 /*break*/, 5];
|
|
2302
|
+
if (!(!ignoreOffLine && this.nc && this.chatUserExternalId && this.chatUserExternalId.length > 0 && this.getBearerToken() && this.getBearerToken().length > 0)) return [3 /*break*/, 4];
|
|
2311
2303
|
_b.label = 1;
|
|
2312
2304
|
case 1:
|
|
2313
2305
|
_b.trys.push([1, 3, , 4]);
|
|
2314
|
-
return [4 /*yield*/, this.
|
|
2306
|
+
return [4 /*yield*/, rxjs.lastValueFrom(this.setOffLine(this.chatUserExternalId))];
|
|
2315
2307
|
case 2:
|
|
2316
2308
|
_b.sent();
|
|
2309
|
+
if (this.debug)
|
|
2310
|
+
console.log("had set offline");
|
|
2317
2311
|
return [3 /*break*/, 4];
|
|
2318
2312
|
case 3:
|
|
2319
2313
|
e_1 = _b.sent();
|
|
2320
|
-
if (this.debug)
|
|
2321
|
-
console.error(e_1);
|
|
2322
|
-
}
|
|
2314
|
+
if (this.debug)
|
|
2315
|
+
console.error("Erro ao setar offline", e_1);
|
|
2323
2316
|
return [3 /*break*/, 4];
|
|
2324
2317
|
case 4:
|
|
2325
|
-
this.nc
|
|
2318
|
+
if (!this.nc) return [3 /*break*/, 9];
|
|
2326
2319
|
_b.label = 5;
|
|
2327
2320
|
case 5:
|
|
2321
|
+
_b.trys.push([5, 7, , 8]);
|
|
2322
|
+
return [4 /*yield*/, this.nc.close()];
|
|
2323
|
+
case 6:
|
|
2324
|
+
_b.sent();
|
|
2325
|
+
return [3 /*break*/, 8];
|
|
2326
|
+
case 7:
|
|
2327
|
+
e_2 = _b.sent();
|
|
2328
|
+
if (this.debug) {
|
|
2329
|
+
console.error(e_2);
|
|
2330
|
+
}
|
|
2331
|
+
return [3 /*break*/, 8];
|
|
2332
|
+
case 8:
|
|
2333
|
+
this.nc = undefined;
|
|
2334
|
+
_b.label = 9;
|
|
2335
|
+
case 9:
|
|
2328
2336
|
if (this.debug) {
|
|
2329
2337
|
console.log("disconect");
|
|
2330
2338
|
}
|
|
@@ -2415,7 +2423,7 @@
|
|
|
2415
2423
|
if (_this.debug) {
|
|
2416
2424
|
console.log("try reconnect...");
|
|
2417
2425
|
}
|
|
2418
|
-
_this.ensureConn(userId);
|
|
2426
|
+
_this.ensureConn(userId, true);
|
|
2419
2427
|
}
|
|
2420
2428
|
}, 1000);
|
|
2421
2429
|
if (this.debug) {
|