mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-10-09 12:47:13 +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;
|
||||
router: any;
|
||||
onValuesChange?: (values: any) => void;
|
||||
}) => (
|
||||
}) => {
|
||||
useEffect(() => {
|
||||
if (onValuesChange) {
|
||||
onValuesChange(initialValues);
|
||||
}
|
||||
}, [initialValues]);
|
||||
|
||||
return (
|
||||
<Formik
|
||||
initialValues={initialValues}
|
||||
validationSchema={Yup.object().shape({
|
||||
@@ -68,12 +75,7 @@ export const SlackTokensForm = ({
|
||||
}}
|
||||
enableReinitialize={true}
|
||||
>
|
||||
{({ isSubmitting, setFieldValue, values }) => {
|
||||
useEffect(() => {
|
||||
onValuesChange?.(values);
|
||||
}, [values, onValuesChange]);
|
||||
|
||||
return (
|
||||
{({ isSubmitting, setFieldValue, values }) => (
|
||||
<Form className="w-full">
|
||||
{!isUpdate && (
|
||||
<div className="">
|
||||
@@ -126,7 +128,7 @@ export const SlackTokensForm = ({
|
||||
</Button>
|
||||
</div>
|
||||
</Form>
|
||||
);
|
||||
}}
|
||||
)}
|
||||
</Formik>
|
||||
);
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user