浏览代码

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