Przeglądaj źródła

110234 remove then

soumaeda 2 lat temu
rodzic
commit
5da422e8dd

+ 1 - 1
apps/app/src/components/InstallerForm.tsx

@@ -65,7 +65,7 @@ const InstallerForm = memo((): JSX.Element => {
 
 
     try {
     try {
       await apiv3Post('/installer', data);
       await apiv3Post('/installer', data);
-      router.push('/').then(() => setIsLoading(false));
+      router.push('/');
     }
     }
     catch (errs) {
     catch (errs) {
       const err = errs[0];
       const err = errs[0];

+ 1 - 1
apps/app/src/components/InvitedForm.tsx

@@ -44,7 +44,7 @@ export const InvitedForm = (props: InvitedFormProps): JSX.Element => {
     try {
     try {
       const res = await apiv3Post('/invited', { invitedForm });
       const res = await apiv3Post('/invited', { invitedForm });
       const { redirectTo } = res.data;
       const { redirectTo } = res.data;
-      router.push(redirectTo ?? '/').then(() => setIsLoading(false));
+      router.push(redirectTo ?? '/');
     }
     }
     catch (err) {
     catch (err) {
       setLoginErrors(err);
       setLoginErrors(err);

+ 3 - 3
apps/app/src/components/LoginForm.tsx

@@ -106,10 +106,10 @@ export const LoginForm = (props: LoginFormProps): JSX.Element => {
       const { redirectTo } = res.data;
       const { redirectTo } = res.data;
 
 
       if (redirectTo != null) {
       if (redirectTo != null) {
-        return router.push(redirectTo).then(() => setIsLoading(false));
+        return router.push(redirectTo);
       }
       }
 
 
-      return router.push('/').then(() => setIsLoading(false));
+      return router.push('/');
     }
     }
     catch (err) {
     catch (err) {
       const errs = toArrayIfNot(err);
       const errs = toArrayIfNot(err);
@@ -314,7 +314,7 @@ export const LoginForm = (props: LoginFormProps): JSX.Element => {
 
 
       const { redirectTo } = res.data;
       const { redirectTo } = res.data;
       if (redirectTo != null) {
       if (redirectTo != null) {
-        router.push(redirectTo).then(() => setIsLoading(false));
+        router.push(redirectTo);
       }
       }
 
 
       if (isEmailAuthenticationEnabled) {
       if (isEmailAuthenticationEnabled) {