aotrautils-srv 0.0.210 → 0.0.213
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
/*utils COMMONS library associated with aotra version : «1.0.0.000 (19/07/2022-03:
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1.0.0.000 (19/07/2022-03:46:31)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -4828,7 +4828,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
4828
4828
|
|
|
4829
4829
|
|
|
4830
4830
|
|
|
4831
|
-
/*utils SERVER library associated with aotra version : «1.0.0.000 (19/07/2022-03:
|
|
4831
|
+
/*utils SERVER library associated with aotra version : «1.0.0.000 (19/07/2022-03:46:31)»*/
|
|
4832
4832
|
/*-----------------------------------------------------------------------------*/
|
|
4833
4833
|
|
|
4834
4834
|
|
|
@@ -6163,13 +6163,25 @@ class ListManager{
|
|
|
6163
6163
|
lognow("ERROR : Cannot add null item.");
|
|
6164
6164
|
return;
|
|
6165
6165
|
}
|
|
6166
|
-
const numberOfItemsCurrently=
|
|
6166
|
+
const numberOfItemsCurrently=getArraySize(this.itemsInfos);
|
|
6167
|
+
|
|
6168
|
+
// DBG
|
|
6169
|
+
lognow(">>>>>>>>>numberOfItemsCurrently:",numberOfItemsCurrently);
|
|
6170
|
+
lognow(">>>>>>>>>Object.keys(arrayOfValues):",Object.keys(this.itemsInfos));
|
|
6171
|
+
|
|
6172
|
+
|
|
6167
6173
|
if(this.maxItemsNumber<=numberOfItemsCurrently){
|
|
6168
6174
|
// TRACE
|
|
6169
6175
|
lognow("ERROR : Cannot add item with id «"+id+"», list already full.");
|
|
6170
6176
|
return;
|
|
6171
6177
|
}
|
|
6178
|
+
|
|
6179
|
+
|
|
6172
6180
|
if(numberOfItemsCurrently==0 && this.mode==="startAtConnexion"){
|
|
6181
|
+
|
|
6182
|
+
// DBG
|
|
6183
|
+
lognow(">>>>>>>>>START SESSION !!!!");
|
|
6184
|
+
|
|
6173
6185
|
this.startSession();
|
|
6174
6186
|
}
|
|
6175
6187
|
this.itemsInfos[id]={
|
|
@@ -6188,15 +6200,28 @@ class ListManager{
|
|
|
6188
6200
|
}
|
|
6189
6201
|
|
|
6190
6202
|
isSessionActive(){
|
|
6203
|
+
|
|
6204
|
+
|
|
6205
|
+
// DBG
|
|
6206
|
+
lognow(" !!! this.sessionDurationSeconds : "+this.sessionDurationSeconds);
|
|
6207
|
+
lognow(" !!! this.started : "+this.started);
|
|
6208
|
+
lognow(" !!! this.time : "+this.time);
|
|
6209
|
+
|
|
6210
|
+
|
|
6191
6211
|
if(!this.sessionDurationSeconds) return true;
|
|
6192
6212
|
if(!this.started) return false;
|
|
6193
|
-
|
|
6213
|
+
const result=!hasDelayPassed(this.time, this.sessionDurationSeconds*1000);
|
|
6214
|
+
|
|
6215
|
+
// DBG
|
|
6216
|
+
lognow(" !!! HAS DELAY PASSED : "+result);
|
|
6217
|
+
|
|
6218
|
+
return result;
|
|
6194
6219
|
}
|
|
6195
6220
|
|
|
6196
6221
|
isClientActive(clientId){
|
|
6197
6222
|
|
|
6198
6223
|
// DBG
|
|
6199
|
-
lognow(" this.isSessionActive()"
|
|
6224
|
+
lognow(" this.isSessionActive()"+this.isSessionActive());
|
|
6200
6225
|
|
|
6201
6226
|
if(!this.isSessionActive()) return false;
|
|
6202
6227
|
const clientPosition=this.getItemPosition(clientId);
|
|
@@ -6227,10 +6252,14 @@ class ListManager{
|
|
|
6227
6252
|
|
|
6228
6253
|
let id=null;
|
|
6229
6254
|
foreach(this.itemsInfos,(itemInfos,key)=>{
|
|
6230
|
-
if(itemInfos.item===item
|
|
6255
|
+
if(itemInfos.item===item
|
|
6256
|
+
// DEBUG ONLY :
|
|
6257
|
+
|| (itemInfos.item.id && item.id && itemInfos.item.id===item.id)
|
|
6258
|
+
){
|
|
6231
6259
|
id=key;
|
|
6232
6260
|
return "break";
|
|
6233
6261
|
}
|
|
6262
|
+
|
|
6234
6263
|
});
|
|
6235
6264
|
|
|
6236
6265
|
if(!id){
|
aotrautils-srv/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils-srv",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.213",
|
|
4
4
|
"main": "aotrautils-srv.build.js",
|
|
5
5
|
"description": "A library for vanilla javascript utils (server-side) used in aotra javascript CMS",
|
|
6
6
|
"author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",
|