@overmap-ai/core 1.0.35-fix-token-refresh-loop.3 → 1.0.35-fix-token-refresh-loop.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.
@@ -10255,6 +10255,7 @@ const PatchFormProvider = memo(
10255
10255
  );
10256
10256
  const validate = useCallback(
10257
10257
  (form) => {
10258
+ console.debug("VALIDATING FORM:", form);
10258
10259
  const error2 = validateForm(schema, form);
10259
10260
  if (error2) {
10260
10261
  onError(error2);
@@ -10275,13 +10276,21 @@ const PatchFormProvider = memo(
10275
10276
  validateOnBlur: false,
10276
10277
  validateOnChange: false
10277
10278
  });
10279
+ const handleBlur = useCallback(() => {
10280
+ if (onDirtyChange) {
10281
+ const diff = getDiff(formik.values);
10282
+ if (hasKeys(diff)) {
10283
+ onDirtyChange(true);
10284
+ }
10285
+ }
10286
+ }, [formik.values, getDiff, onDirtyChange]);
10278
10287
  const { errors, resetForm } = formik;
10279
10288
  useEffect(() => {
10280
10289
  if (hasKeys(errors)) {
10281
10290
  resetForm({ values: initialValues2, errors: {} });
10282
10291
  }
10283
10292
  }, [errors, initialValues2, resetForm]);
10284
- return /* @__PURE__ */ jsx(FormikProvider, { value: formik, children: /* @__PURE__ */ jsx("form", { ...rest, ref, onSubmit: formik.handleSubmit, children }) });
10293
+ return /* @__PURE__ */ jsx(FormikProvider, { value: formik, children: /* @__PURE__ */ jsx("form", { ...rest, ref, onSubmit: formik.handleSubmit, onBlur: handleBlur, children }) });
10285
10294
  })
10286
10295
  );
10287
10296
  const typeBadge$1 = "_typeBadge_an5ff_1";