@widgetic/editor 3.10.54 → 3.10.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/editor",
3
- "version": "3.10.54",
3
+ "version": "3.10.55",
4
4
  "scripts": {
5
5
  "start": "webpack --config webpack.config.js --watch --progress",
6
6
  "build": "webpack --config webpack.config.js",
@@ -275,7 +275,7 @@ export default {
275
275
  // // console.log("noIdA & noIdB: ", noIdA, noIdB, (noIdA - noIdB));
276
276
  // return noIdA - noIdB;
277
277
  // });
278
- // console.log("uploadedFiles after sort: ", files);
278
+ // console.log("uploadedFiles before sort: ", files);
279
279
 
280
280
  // sort files by last modified(uploadTime) date
281
281
  files = files.sort((a, b) => {
@@ -284,7 +284,10 @@ export default {
284
284
  let x = a.lastModified;
285
285
 
286
286
  // read the lastModified date from the id
287
- if(!x) x = a.id.substring(a.id.indexOf('_u')+3);
287
+ if(!x && a.id) {
288
+ let indexOft = a.id.indexOf('_u');
289
+ if(indexOft) x = a.id.substring(indexOft+3);
290
+ }
288
291
 
289
292
  // if still not available then set it to 0
290
293
  if(!x) x = 0;
@@ -295,7 +298,10 @@ export default {
295
298
  let y = b.lastModified;
296
299
 
297
300
  // read the lastModified date from the id
298
- if(!y) y = b.id.substring(b.id.indexOf('_u')+3);
301
+ if(!y && b.id) {
302
+ let indexOft = b.id.indexOf('_u');
303
+ if(indexOft) y = b.id.substring(indexOft+3);
304
+ }
299
305
 
300
306
  // if still not available then set it to 0
301
307
  if(!y) y = 0;