@brggroup/share-lib 0.0.78 → 0.0.79
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/brggroup-share-lib.mjs +14 -7
- package/fesm2022/brggroup-share-lib.mjs.map +1 -1
- package/lib/app-global.d.ts +1 -0
- package/lib/app-global.d.ts.map +1 -1
- package/lib/auth/auth.service.d.ts +1 -2
- package/lib/auth/auth.service.d.ts.map +1 -1
- package/lib/model.d.ts +1 -0
- package/lib/model.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -129,6 +129,7 @@ var TranslateKey;
|
|
|
129
129
|
class AppGlobals {
|
|
130
130
|
static apiEndpoint;
|
|
131
131
|
static versionCheck;
|
|
132
|
+
static idleTimeInMinutes; // phút
|
|
132
133
|
static MENU_TYPE = 'toolbar-menu';
|
|
133
134
|
static pageSizeOptions = [10, 20, 50, 100];
|
|
134
135
|
static filterSet = {};
|
|
@@ -680,14 +681,20 @@ class AuthService extends HTTPService {
|
|
|
680
681
|
return this.postData(AppGlobals.apiEndpoint + URLs$4.register, d);
|
|
681
682
|
}
|
|
682
683
|
idleTimer;
|
|
683
|
-
|
|
684
|
-
|
|
684
|
+
get idleTime() {
|
|
685
|
+
return (AppGlobals.idleTimeInMinutes || 0) * 60 * 1000;
|
|
686
|
+
}
|
|
685
687
|
startWatching() {
|
|
686
|
-
console.log(`-- start watching idle (${
|
|
687
|
-
this.
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
688
|
+
console.log(`-- start watching idle (${AppGlobals.idleTimeInMinutes} 'min(s)'}) --`);
|
|
689
|
+
if (this.idleTime > 0) {
|
|
690
|
+
this.resetTimer();
|
|
691
|
+
window.addEventListener('mousemove', () => this.resetTimer());
|
|
692
|
+
window.addEventListener('keydown', () => this.resetTimer());
|
|
693
|
+
window.addEventListener('click', () => this.resetTimer());
|
|
694
|
+
}
|
|
695
|
+
else {
|
|
696
|
+
this.stopWatching();
|
|
697
|
+
}
|
|
691
698
|
}
|
|
692
699
|
resetTimer() {
|
|
693
700
|
if (this.idleTimer) {
|