contentoh-components-library 21.5.34 → 21.5.35

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.
@@ -2439,14 +2439,30 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2439
2439
  type: "message",
2440
2440
  value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
2441
2441
  }];
2442
- _context21.next = 4;
2442
+
2443
+ if (messages[0].value.trim()) {
2444
+ _context21.next = 5;
2445
+ break;
2446
+ }
2447
+
2448
+ // Check if the message is empty or only contains whitespace
2449
+ setMessage("Escribe un mensaje"); // Display a message to the user
2450
+
2451
+ return _context21.abrupt("return");
2452
+
2453
+ case 5:
2454
+ setMessage(""); // Clear any previous message
2455
+
2456
+ _context21.next = 8;
2443
2457
  return createComment(messages[0].value);
2444
2458
 
2445
- case 4:
2446
- validatedAll ? validateAll("R") : sendToEvaluation("R");
2447
- setShowRejectModal(false);
2459
+ case 8:
2460
+ // Proceed with creating the comment
2461
+ validatedAll ? validateAll("R") : sendToEvaluation("R"); // Perform the appropriate action
2462
+
2463
+ setShowRejectModal(false); // Close the modal
2448
2464
 
2449
- case 6:
2465
+ case 10:
2450
2466
  case "end":
2451
2467
  return _context21.stop();
2452
2468
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.5.34",
3
+ "version": "21.5.35",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -1766,9 +1766,15 @@ export const ProviderProductEdition = ({
1766
1766
  const messages = [
1767
1767
  { type: "message", value: body?.replace(/<.*?\/?>/gm, "") },
1768
1768
  ];
1769
- await createComment(messages[0].value);
1770
- validatedAll ? validateAll("R") : sendToEvaluation("R");
1771
- setShowRejectModal(false);
1769
+
1770
+ if (!messages[0].value.trim()) { // Check if the message is empty or only contains whitespace
1771
+ setMessage("Escribe un mensaje"); // Display a message to the user
1772
+ return; // Exit the function without proceeding
1773
+ }
1774
+ setMessage(""); // Clear any previous message
1775
+ await createComment(messages[0].value); // Proceed with creating the comment
1776
+ validatedAll ? validateAll("R") : sendToEvaluation("R"); // Perform the appropriate action
1777
+ setShowRejectModal(false); // Close the modal
1772
1778
  }}
1773
1779
  />,
1774
1780
  ]}