config-editor-base 2.0.3 → 2.0.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/dist/index.js CHANGED
@@ -438,6 +438,38 @@ var resetLocalSchemaList = function resetLocalSchemaList() {
438
438
  };
439
439
  var saveUpdatedConfiguration = function saveUpdatedConfiguration(filename, content) {
440
440
  return function (dispatch) {
441
+ var contentJSON = JSON.parse(content);
442
+
443
+ if (contentJSON.can_2 != undefined) {
444
+ var transmitList1 = contentJSON.can_1.transmit;
445
+ var transmitList2 = contentJSON.can_2.transmit;
446
+ transmitList1Filtered = transmitList1.filter(function (e) {
447
+ return e.period < e.delay;
448
+ });
449
+ transmitList2Filtered = transmitList2.filter(function (e) {
450
+ return e.period < e.delay;
451
+ });
452
+ }
453
+
454
+ console.log("transmitList1Filtered", transmitList1Filtered);
455
+ console.log("transmitList2Filtered", transmitList2Filtered);
456
+
457
+ if (transmitList1Filtered.length > 0) {
458
+ dispatch(set({
459
+ type: "warning",
460
+ message: "Your CAN CH1 transmit list includes one or more entries with period < delay. This is invalid and will cause the device to reject your Configuration File.",
461
+ autoClear: false
462
+ }));
463
+ }
464
+
465
+ if (transmitList2Filtered.length > 0) {
466
+ dispatch(set({
467
+ type: "warning",
468
+ message: "Your CAN CH2 transmit list includes one or more entries with period < delay. This is invalid and will cause the device to reject your Configuration File.",
469
+ autoClear: false
470
+ }));
471
+ }
472
+
441
473
  dispatch(setConfigContent(content));
442
474
  var blob = new Blob([JSON.stringify(content, null, 2)], {
443
475
  type: "text/json"