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

This commit is contained in:
Nicolas Meienberger 2023-04-20 07:52:46 +02:00 committed by Nicolas Meienberger
parent 06099c0ae4
commit 2e5cb6b2b0

View file

@ -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}`);
},
});