@overmap-ai/core 1.0.35-fix-token-refresh-loop.3 → 1.0.35-fix-token-refresh-loop.5
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/overmap-core.js
CHANGED
|
@@ -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,22 @@ const PatchFormProvider = memo(
|
|
|
10275
10276
|
validateOnBlur: false,
|
|
10276
10277
|
validateOnChange: false
|
|
10277
10278
|
});
|
|
10279
|
+
const handleChange = useCallback(() => {
|
|
10280
|
+
if (onDirtyChange) {
|
|
10281
|
+
console.debug("ON CHANGE");
|
|
10282
|
+
const diff = getDiff(formik.values);
|
|
10283
|
+
if (hasKeys(diff)) {
|
|
10284
|
+
onDirtyChange(true);
|
|
10285
|
+
}
|
|
10286
|
+
}
|
|
10287
|
+
}, [formik.values, getDiff, onDirtyChange]);
|
|
10278
10288
|
const { errors, resetForm } = formik;
|
|
10279
10289
|
useEffect(() => {
|
|
10280
10290
|
if (hasKeys(errors)) {
|
|
10281
10291
|
resetForm({ values: initialValues2, errors: {} });
|
|
10282
10292
|
}
|
|
10283
10293
|
}, [errors, initialValues2, resetForm]);
|
|
10284
|
-
return /* @__PURE__ */ jsx(FormikProvider, { value: formik, children: /* @__PURE__ */ jsx("form", { ...rest, ref, onSubmit: formik.handleSubmit, children }) });
|
|
10294
|
+
return /* @__PURE__ */ jsx(FormikProvider, { value: formik, children: /* @__PURE__ */ jsx("form", { ...rest, ref, onSubmit: formik.handleSubmit, onChange: handleChange, children }) });
|
|
10285
10295
|
})
|
|
10286
10296
|
);
|
|
10287
10297
|
const typeBadge$1 = "_typeBadge_an5ff_1";
|