瀏覽代碼

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);
         });
     }
   };