@bizdoc/core 3.9.7 → 3.10.0
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/fesm2022/bizdoc-core.mjs +21 -15
- package/fesm2022/bizdoc-core.mjs.map +1 -1
- package/index.d.ts +6 -2
- package/package.json +1 -1
package/fesm2022/bizdoc-core.mjs
CHANGED
@@ -1122,7 +1122,7 @@ class SessionService {
|
|
1122
1122
|
*/
|
1123
1123
|
prepare() {
|
1124
1124
|
const promises = [];
|
1125
|
-
|
1125
|
+
loadServiceWorker();
|
1126
1126
|
this._config.maps && promises.push(this._loadGoogleMaps());
|
1127
1127
|
promises.push(this._changeTheme(this.theme));
|
1128
1128
|
return Promise.all(promises);
|
@@ -1175,15 +1175,15 @@ class SessionService {
|
|
1175
1175
|
});
|
1176
1176
|
}
|
1177
1177
|
reportInboxRead(date, move) {
|
1178
|
-
const {
|
1179
|
-
|
1180
|
-
|
1178
|
+
const { inboxTouch } = this._profile.options;
|
1179
|
+
inboxTouch !== undefined &&
|
1180
|
+
inboxTouch < date &&
|
1181
1181
|
this._stepInboxCount(move);
|
1182
1182
|
}
|
1183
1183
|
reportNotificationsRead(date, move) {
|
1184
|
-
const {
|
1185
|
-
|
1186
|
-
|
1184
|
+
const { notificationsTouch } = this._profile.options;
|
1185
|
+
notificationsTouch !== undefined &&
|
1186
|
+
notificationsTouch < date &&
|
1187
1187
|
!this.isImpersonating &&
|
1188
1188
|
this._stepNotificationsCount(move);
|
1189
1189
|
}
|
@@ -1214,10 +1214,10 @@ class SessionService {
|
|
1214
1214
|
return this._accentpalette;
|
1215
1215
|
}
|
1216
1216
|
_isAboveWatermark(date) {
|
1217
|
-
const {
|
1217
|
+
const { notificationsTouch } = this.profile.options;
|
1218
1218
|
return !this.isImpersonating &&
|
1219
|
-
|
1220
|
-
|
1219
|
+
notificationsTouch !== undefined &&
|
1220
|
+
notificationsTouch < date;
|
1221
1221
|
}
|
1222
1222
|
get primeryPalette() {
|
1223
1223
|
return this._primarypalette;
|
@@ -1279,6 +1279,12 @@ class SessionService {
|
|
1279
1279
|
this.profile.available = value === 'Online' ? null : value;
|
1280
1280
|
this._http.put(`/api/account/available?mode=${this.profile.available || ''}`, {}).subscribe();
|
1281
1281
|
}
|
1282
|
+
get timeZone() { return this._profile.options.timeZone || Intl.DateTimeFormat().resolvedOptions().timeZone; }
|
1283
|
+
set timeZone(value) {
|
1284
|
+
this._http.put('/api/account/timezone', {
|
1285
|
+
value
|
1286
|
+
}).subscribe();
|
1287
|
+
}
|
1282
1288
|
isInRole(role) {
|
1283
1289
|
return this._http.get('/api/account/isInRole', {
|
1284
1290
|
params: { role },
|
@@ -1356,7 +1362,7 @@ class SessionService {
|
|
1356
1362
|
}
|
1357
1363
|
return firstValueFrom(this._http.put('/api/account/inboxview', {}, { headers: { 'no-progress': 'true' } }).pipe(tap(e => {
|
1358
1364
|
this._stepInboxCount(0);
|
1359
|
-
this._profile.options.
|
1365
|
+
this._profile.options.inboxTouch = e.time;
|
1360
1366
|
})));
|
1361
1367
|
}
|
1362
1368
|
markNotificationsAsTouched() {
|
@@ -1366,7 +1372,7 @@ class SessionService {
|
|
1366
1372
|
}
|
1367
1373
|
return firstValueFrom(this._http.put('/api/account/notificationsView', {}, { headers: { 'no-progress': 'true' } }).pipe(tap(e => {
|
1368
1374
|
this._stepNotificationsCount(0);
|
1369
|
-
this._profile.options.
|
1375
|
+
this._profile.options.notificationsTouch = e.time;
|
1370
1376
|
})));
|
1371
1377
|
}
|
1372
1378
|
_constructPalette(color) {
|
@@ -1455,9 +1461,9 @@ function promote(move, counter) {
|
|
1455
1461
|
return counter;
|
1456
1462
|
}
|
1457
1463
|
function loadServiceWorker() {
|
1458
|
-
window.addEventListener('load', function () {
|
1459
|
-
navigator.serviceWorker.register('/js/app-sw.js').then(function () {
|
1460
|
-
}, null);
|
1464
|
+
('serviceWorker' in navigator) && window.addEventListener('load', function () {
|
1465
|
+
setTimeout(() => navigator.serviceWorker.register('/js/app-sw.js').then(function () {
|
1466
|
+
}, null), 5000);
|
1461
1467
|
});
|
1462
1468
|
}
|
1463
1469
|
|