mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-28 04:49:21 +02:00
moved it outside
This commit is contained in:
@@ -24,7 +24,14 @@ export const SlackTokensForm = ({
|
|||||||
setPopup: (popup: { message: string; type: "error" | "success" }) => void;
|
setPopup: (popup: { message: string; type: "error" | "success" }) => void;
|
||||||
router: any;
|
router: any;
|
||||||
onValuesChange?: (values: any) => void;
|
onValuesChange?: (values: any) => void;
|
||||||
}) => (
|
}) => {
|
||||||
|
useEffect(() => {
|
||||||
|
if (onValuesChange) {
|
||||||
|
onValuesChange(initialValues);
|
||||||
|
}
|
||||||
|
}, [initialValues]);
|
||||||
|
|
||||||
|
return (
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
validationSchema={Yup.object().shape({
|
validationSchema={Yup.object().shape({
|
||||||
@@ -68,12 +75,7 @@ export const SlackTokensForm = ({
|
|||||||
}}
|
}}
|
||||||
enableReinitialize={true}
|
enableReinitialize={true}
|
||||||
>
|
>
|
||||||
{({ isSubmitting, setFieldValue, values }) => {
|
{({ isSubmitting, setFieldValue, values }) => (
|
||||||
useEffect(() => {
|
|
||||||
onValuesChange?.(values);
|
|
||||||
}, [values, onValuesChange]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Form className="w-full">
|
<Form className="w-full">
|
||||||
{!isUpdate && (
|
{!isUpdate && (
|
||||||
<div className="">
|
<div className="">
|
||||||
@@ -126,7 +128,7 @@ export const SlackTokensForm = ({
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
);
|
)}
|
||||||
}}
|
|
||||||
</Formik>
|
</Formik>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
Reference in New Issue
Block a user