@cocreate/users 1.37.2 → 1.37.4
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/CHANGELOG.md +15 -0
- package/package.json +1 -1
- package/src/client.js +13 -5
- package/src/server.js +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [1.37.4](https://github.com/CoCreate-app/CoCreate-users/compare/v1.37.3...v1.37.4) (2024-07-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* checkSession send ([2b3810f](https://github.com/CoCreate-app/CoCreate-users/commit/2b3810fd31bbd1e4fbd8f7072f5e36c8b13abac4))
|
|
7
|
+
|
|
8
|
+
## [1.37.3](https://github.com/CoCreate-app/CoCreate-users/compare/v1.37.2...v1.37.3) (2024-06-30)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* checkSession debounce function ([6229d80](https://github.com/CoCreate-app/CoCreate-users/commit/6229d8089e0a509d0c171f6e329cd3fcce495356))
|
|
14
|
+
* debounce check session ([2a31537](https://github.com/CoCreate-app/CoCreate-users/commit/2a315373bbebae765d91392118aee92216b6456a))
|
|
15
|
+
|
|
1
16
|
## [1.37.2](https://github.com/CoCreate-app/CoCreate-users/compare/v1.37.1...v1.37.2) (2024-06-23)
|
|
2
17
|
|
|
3
18
|
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -458,16 +458,24 @@ Actions.init([
|
|
|
458
458
|
}
|
|
459
459
|
]);
|
|
460
460
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
callback: () => {
|
|
461
|
+
let checkSessionTimeout
|
|
462
|
+
function checkSession() {
|
|
463
|
+
clearTimeout(checkSessionTimeout);
|
|
464
|
+
checkSessionTimeout = setTimeout(function () {
|
|
466
465
|
Crud.socket.send({
|
|
467
466
|
method: 'checkSession',
|
|
468
467
|
broadcast: false,
|
|
469
468
|
broadcastBrowser: false
|
|
470
469
|
});
|
|
470
|
+
}, 500);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
Observer.init({
|
|
474
|
+
name: 'CoCreateUserSessionAddedNodes',
|
|
475
|
+
observe: ['addedNodes'],
|
|
476
|
+
target: '[session]',
|
|
477
|
+
callback: () => {
|
|
478
|
+
checkSession();
|
|
471
479
|
}
|
|
472
480
|
});
|
|
473
481
|
|
package/src/server.js
CHANGED
|
@@ -147,12 +147,14 @@ class CoCreateUser {
|
|
|
147
147
|
|
|
148
148
|
async checkSession(data) {
|
|
149
149
|
try {
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
data.method = 'updateUserStatus'
|
|
151
|
+
|
|
152
|
+
if (!data.socket.user_id)
|
|
152
153
|
data.userStatus = 'off'
|
|
154
|
+
else
|
|
155
|
+
data.userStatus = 'on'
|
|
153
156
|
|
|
154
|
-
|
|
155
|
-
}
|
|
157
|
+
this.wsManager.send(data)
|
|
156
158
|
} catch (error) {
|
|
157
159
|
console.log('checkSession error')
|
|
158
160
|
}
|