From 73598e8af63dcc65a7b24ead890d21ab7400609c Mon Sep 17 00:00:00 2001
From: shuai <lishuailing@sifou.com>
Date: Sat, 6 May 2023 15:44:25 +0800
Subject: [PATCH] fix: change emial need confirm password

---
 .../Account/components/ModifyEmail/index.tsx        | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/ui/src/pages/Users/Settings/Account/components/ModifyEmail/index.tsx b/ui/src/pages/Users/Settings/Account/components/ModifyEmail/index.tsx
index 173cbfd6..ff1a58ca 100644
--- a/ui/src/pages/Users/Settings/Account/components/ModifyEmail/index.tsx
+++ b/ui/src/pages/Users/Settings/Account/components/ModifyEmail/index.tsx
@@ -52,12 +52,6 @@ const Index: FC = () => {
     });
   };
 
-  useEffect(() => {
-    if (step > 1) {
-      getImgCode();
-    }
-  }, [step]);
-
   const handleChange = (params: Type.FormDataType) => {
     setFormData({ ...formData, ...params });
   };
@@ -172,7 +166,12 @@ const Index: FC = () => {
             />
           </Form.Group>
 
-          <Button variant="outline-secondary" onClick={() => setStep(2)}>
+          <Button
+            variant="outline-secondary"
+            onClick={() => {
+              setStep(2);
+              getImgCode();
+            }}>
             {t('change_email_btn')}
           </Button>
         </Form>