@onehat/ui 0.3.267 → 0.3.268

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": "@onehat/ui",
3
- "version": "0.3.267",
3
+ "version": "0.3.268",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -409,6 +409,11 @@ export default function withSecondaryEditor(WrappedComponent, isTree = false) {
409
409
  secondarySetIsEditorShown(false);
410
410
  }
411
411
  const formState = secondaryEditorStateRef.current;
412
+ if (!formState) {
413
+ setIsAdding(false);
414
+ secondarySetIsEditorShown(false);
415
+ return;
416
+ }
412
417
  if (!_.isEmpty(formState.dirtyFields)) {
413
418
  confirm('This record has unsaved changes. Are you sure you want to cancel editing? Changes will be lost.', doIt);
414
419
  } else {
@@ -408,6 +408,11 @@ export default function withEditor(WrappedComponent, isTree = false) {
408
408
  setIsEditorShown(false);
409
409
  }
410
410
  const formState = editorStateRef.current;
411
+ if (!formState) {
412
+ setIsAdding(false);
413
+ setIsEditorShown(false);
414
+ return;
415
+ }
411
416
  if (!_.isEmpty(formState.dirtyFields)) {
412
417
  confirm('This record has unsaved changes. Are you sure you want to cancel editing? Changes will be lost.', doIt);
413
418
  } else {