@sumaris-net/ngx-components 1.9.6 → 1.9.9
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 +16 -8
- 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/core/graphql/graphql.service.js +4 -4
- package/esm2015/src/app/core/services/account.service.js +8 -4
- package/esm2015/src/app/shared/services/startable-service.class.js +4 -1
- package/esm2015/src/environments/environment.class.js +1 -1
- package/esm2015/src/environments/environment.js +4 -3
- package/fesm2015/sumaris-net.ngx-components.js +16 -8
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/core/services/account.service.d.ts +4 -2
- package/src/app/shared/services/startable-service.class.d.ts +1 -0
- package/src/assets/i18n/en-US.json +4 -1
- package/src/assets/i18n/en.json +4 -1
- package/src/assets/i18n/fr.json +4 -1
- package/src/environments/environment.class.d.ts +2 -1
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -9414,6 +9414,9 @@
|
|
|
9414
9414
|
this._subscription = this._subscription || new rxjs.Subscription();
|
|
9415
9415
|
return this._subscription.add(sub);
|
|
9416
9416
|
};
|
|
9417
|
+
StartableService.prototype.unregisterSubscription = function (sub) {
|
|
9418
|
+
this._subscription.remove(sub);
|
|
9419
|
+
};
|
|
9417
9420
|
StartableService.prototype.ngOnStop = function () {
|
|
9418
9421
|
return __awaiter(this, void 0, void 0, function () {
|
|
9419
9422
|
return __generator(this, function (_a) {
|
|
@@ -10669,10 +10672,11 @@
|
|
|
10669
10672
|
},
|
|
10670
10673
|
account: {
|
|
10671
10674
|
enableListenChanges: true,
|
|
10672
|
-
|
|
10675
|
+
listenIntervalInSeconds: 30
|
|
10673
10676
|
},
|
|
10674
10677
|
entityEditor: {
|
|
10675
|
-
enableListenChanges:
|
|
10678
|
+
enableListenChanges: true,
|
|
10679
|
+
listenIntervalInSeconds: 30
|
|
10676
10680
|
}
|
|
10677
10681
|
});
|
|
10678
10682
|
|
|
@@ -14857,7 +14861,7 @@
|
|
|
14857
14861
|
case 0:
|
|
14858
14862
|
client = (client || this.client);
|
|
14859
14863
|
if (!client) return [3 /*break*/, 2];
|
|
14860
|
-
console.info('[graphql]
|
|
14864
|
+
console.info('[graphql] Cleaning cache... ');
|
|
14861
14865
|
now = this._debug && Date.now();
|
|
14862
14866
|
// Clearing the cache
|
|
14863
14867
|
return [4 /*yield*/, client.cache.reset()];
|
|
@@ -14865,7 +14869,7 @@
|
|
|
14865
14869
|
// Clearing the cache
|
|
14866
14870
|
_a.sent();
|
|
14867
14871
|
if (this._debug)
|
|
14868
|
-
console.debug("[graphql]
|
|
14872
|
+
console.debug("[graphql] Cleaning cache [OK] in " + (Date.now() - now) + "ms");
|
|
14869
14873
|
_a.label = 2;
|
|
14870
14874
|
case 2: return [2 /*return*/];
|
|
14871
14875
|
}
|
|
@@ -15050,7 +15054,7 @@
|
|
|
15050
15054
|
client = (client || this.apollo.client);
|
|
15051
15055
|
if (!client)
|
|
15052
15056
|
return [2 /*return*/];
|
|
15053
|
-
console.info('[graphql] Resetting
|
|
15057
|
+
console.info('[graphql] Resetting Apollo client...');
|
|
15054
15058
|
client.stop();
|
|
15055
15059
|
return [4 /*yield*/, Promise.all([
|
|
15056
15060
|
client.clearStore(),
|
|
@@ -15869,7 +15873,7 @@
|
|
|
15869
15873
|
});
|
|
15870
15874
|
});
|
|
15871
15875
|
};
|
|
15872
|
-
AccountService.prototype.reload = function () {
|
|
15876
|
+
AccountService.prototype.reload = function (opts) {
|
|
15873
15877
|
return __awaiter(this, void 0, void 0, function () {
|
|
15874
15878
|
var now, wasLogin, error_6;
|
|
15875
15879
|
return __generator(this, function (_b) {
|
|
@@ -15895,6 +15899,10 @@
|
|
|
15895
15899
|
// Emit login event to subscribers
|
|
15896
15900
|
this.onLogin.next(this._data);
|
|
15897
15901
|
this.onChange.next(this._data);
|
|
15902
|
+
// Display toast (without await, because not need to wait toast close event)
|
|
15903
|
+
if (!opts || opts.showToast !== false) {
|
|
15904
|
+
this.showToast({ message: 'ACCOUNT.INFO.RELOADED', type: 'info' });
|
|
15905
|
+
}
|
|
15898
15906
|
return [2 /*return*/, this._data];
|
|
15899
15907
|
case 4:
|
|
15900
15908
|
error_6 = _b.sent();
|
|
@@ -16645,7 +16653,7 @@
|
|
|
16645
16653
|
if (this.network.offline)
|
|
16646
16654
|
throw new Error('Cannot watch account changes: network is offline.');
|
|
16647
16655
|
var variables = {
|
|
16648
|
-
interval: Math.max(0, (opts === null || opts === void 0 ? void 0 : opts.
|
|
16656
|
+
interval: Math.max(0, (opts === null || opts === void 0 ? void 0 : opts.intervalInSeconds) || ((_a = this.environment.account) === null || _a === void 0 ? void 0 : _a.listenIntervalInSeconds) || 0)
|
|
16649
16657
|
};
|
|
16650
16658
|
console.debug("[account] Watching remote changes, every " + variables.interval + "s");
|
|
16651
16659
|
return this.graphql.subscribe({
|
|
@@ -16653,7 +16661,7 @@
|
|
|
16653
16661
|
variables: variables,
|
|
16654
16662
|
error: {
|
|
16655
16663
|
code: ErrorCodes$2.SUBSCRIBE_ACCOUNT_ERROR,
|
|
16656
|
-
message: 'ERROR.ACCOUNT.
|
|
16664
|
+
message: 'ERROR.ACCOUNT.SUBSCRIBE_ERROR'
|
|
16657
16665
|
}
|
|
16658
16666
|
}).pipe(operators.map(function (_b) {
|
|
16659
16667
|
var data = _b.data;
|