@sumaris-net/ngx-components 1.21.0-beta15 → 1.21.0-beta16
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/sumaris-net.ngx-components.umd.js +33 -30
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/esm2015/src/app/social/user-event/notification/user-event-notification.component.js +26 -25
- package/fesm2015/sumaris-net.ngx-components.js +25 -23
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/social/user-event/notification/user-event-notification.component.d.ts +4 -3
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -31023,7 +31023,6 @@
|
|
|
31023
31023
|
this.debug = false;
|
|
31024
31024
|
this.titleI18n = 'SOCIAL.USER_EVENT.NOTIFICATION.TITLE';
|
|
31025
31025
|
this.disabled = false;
|
|
31026
|
-
this._subscriptions = new rxjs.Subscription();
|
|
31027
31026
|
this._logPrefix = '[user-event-notification] ';
|
|
31028
31027
|
this._readEvent = new i0.EventEmitter();
|
|
31029
31028
|
}
|
|
@@ -31050,31 +31049,8 @@
|
|
|
31050
31049
|
case 1:
|
|
31051
31050
|
_b.sent();
|
|
31052
31051
|
// listen login/logout
|
|
31053
|
-
this.
|
|
31054
|
-
|
|
31055
|
-
var _this = this;
|
|
31056
|
-
return __generator(this, function (_b) {
|
|
31057
|
-
switch (_b.label) {
|
|
31058
|
-
case 0: return [4 /*yield*/, this.userEventService.count(undefined)];
|
|
31059
|
-
case 1:
|
|
31060
|
-
count = _b.sent();
|
|
31061
|
-
if (this.debug)
|
|
31062
|
-
console.debug(this._logPrefix + "Receiving user events count", count);
|
|
31063
|
-
this.markForCheck();
|
|
31064
|
-
// Then listen changes
|
|
31065
|
-
return [2 /*return*/, this.userEventService.listenCountChanges(undefined).subscribe(function (count) {
|
|
31066
|
-
if (_this.debug)
|
|
31067
|
-
console.debug(_this._logPrefix + "Receiving new user events count", count);
|
|
31068
|
-
_this.markForCheck();
|
|
31069
|
-
})];
|
|
31070
|
-
}
|
|
31071
|
-
});
|
|
31072
|
-
}); });
|
|
31073
|
-
this._subscriptions.add(this._loginSubscription);
|
|
31074
|
-
this._subscriptions.add(this.accountService.onLogout.subscribe(function () {
|
|
31075
|
-
if (_this._loginSubscription)
|
|
31076
|
-
_this._subscriptions.remove(_this._loginSubscription);
|
|
31077
|
-
}));
|
|
31052
|
+
this.accountService.onLogin.subscribe(function () { return _this.onLogin(); });
|
|
31053
|
+
this.accountService.onLogout.subscribe(function () { return _this.onLogout(); });
|
|
31078
31054
|
// Subscribe to read event
|
|
31079
31055
|
this._readEvent.subscribe(function (value) {
|
|
31080
31056
|
// default: mark event as read
|
|
@@ -31113,14 +31089,41 @@
|
|
|
31113
31089
|
});
|
|
31114
31090
|
});
|
|
31115
31091
|
};
|
|
31116
|
-
UserEventNotificationComponent.prototype.markForCheck = function () {
|
|
31117
|
-
this.cd.markForCheck();
|
|
31118
|
-
};
|
|
31119
31092
|
UserEventNotificationComponent.prototype.ngOnDestroy = function () {
|
|
31120
31093
|
if (this.debug) {
|
|
31121
31094
|
console.debug(this._logPrefix + "Destroying");
|
|
31122
31095
|
}
|
|
31123
|
-
this.
|
|
31096
|
+
this.onLogout();
|
|
31097
|
+
};
|
|
31098
|
+
UserEventNotificationComponent.prototype.onLogin = function () {
|
|
31099
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
31100
|
+
var count;
|
|
31101
|
+
var _this = this;
|
|
31102
|
+
return __generator(this, function (_b) {
|
|
31103
|
+
switch (_b.label) {
|
|
31104
|
+
case 0: return [4 /*yield*/, this.userEventService.count(undefined)];
|
|
31105
|
+
case 1:
|
|
31106
|
+
count = _b.sent();
|
|
31107
|
+
if (this.debug)
|
|
31108
|
+
console.debug(this._logPrefix + "Receiving user events count", count);
|
|
31109
|
+
this.markForCheck();
|
|
31110
|
+
// Then listen changes
|
|
31111
|
+
this._listenSubscription = this.userEventService.listenCountChanges(undefined).subscribe(function (count) {
|
|
31112
|
+
if (_this.debug)
|
|
31113
|
+
console.debug(_this._logPrefix + "Receiving new user events count", count);
|
|
31114
|
+
_this.markForCheck();
|
|
31115
|
+
});
|
|
31116
|
+
return [2 /*return*/];
|
|
31117
|
+
}
|
|
31118
|
+
});
|
|
31119
|
+
});
|
|
31120
|
+
};
|
|
31121
|
+
UserEventNotificationComponent.prototype.onLogout = function () {
|
|
31122
|
+
var _a;
|
|
31123
|
+
(_a = this._listenSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
31124
|
+
};
|
|
31125
|
+
UserEventNotificationComponent.prototype.markForCheck = function () {
|
|
31126
|
+
this.cd.markForCheck();
|
|
31124
31127
|
};
|
|
31125
31128
|
return UserEventNotificationComponent;
|
|
31126
31129
|
}());
|