소스 검색

fix: remove onsettled callback after restart/update and set loader to false only in case of error

Nicolas Meienberger 2 년 전
부모
커밋
2e5cb6b2b0
1개의 변경된 파일2개의 추가작업 그리고 6개의 파일을 삭제
  1. 2 6
      src/client/modules/Settings/containers/GeneralActions/GeneralActions.tsx

+ 2 - 6
src/client/modules/Settings/containers/GeneralActions/GeneralActions.tsx

@@ -31,10 +31,8 @@ export const GeneralActions = () => {
     },
     },
     onError: (error) => {
     onError: (error) => {
       updateDisclosure.close();
       updateDisclosure.close();
-      toast.error(`Error updating instance: ${error.message}`);
-    },
-    onSettled: () => {
       setLoading(false);
       setLoading(false);
+      toast.error(`Error updating instance: ${error.message}`);
     },
     },
   });
   });
 
 
@@ -48,10 +46,8 @@ export const GeneralActions = () => {
     },
     },
     onError: (error) => {
     onError: (error) => {
       restartDisclosure.close();
       restartDisclosure.close();
-      toast.error(`Error restarting instance: ${error.message}`);
-    },
-    onSettled: () => {
       setLoading(false);
       setLoading(false);
+      toast.error(`Error restarting instance: ${error.message}`);
     },
     },
   });
   });