Преглед изворни кода

Reload fix (#2955)

* package

* reload fix

---------

Co-authored-by: Justin Rhee <jusrhee@Justins-MacBook-Air.local>
jusrhee пре 3 година
родитељ
комит
ff665640ff
1 измењених фајлова са 3 додато и 2 уклоњено
  1. 3 2
      dashboard/src/main/auth/Register.tsx

+ 3 - 2
dashboard/src/main/auth/Register.tsx

@@ -105,11 +105,12 @@ const Register: React.FC<Props> = ({
         })
         .catch((err) => {
           console.log("registration:", err);
-          location.reload();
-          setButtonDisabled(false);
           if (err.response?.data?.error) {
             setCurrentError(err.response.data.error)
+          } else {
+            location.reload();
           }
+          setButtonDisabled(false);
         });
     }
   };