Skip to content

Commit

Permalink
feat: Improve flow status form UX
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed May 29, 2024
1 parent e4cfb30 commit f8aa016
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,13 @@ const ServiceSettings: React.FC = () => {
initialValues: {
status: flowStatus || "online",
},
onSubmit: async ({ status }) => {
await updateFlowStatus(status);
setIsAlertOpen(true);
onSubmit: async (values, { resetForm }) => {
const isSuccess = await updateFlowStatus(values.status);
if (isSuccess) {
setIsAlertOpen(true);
// Reset "dirty" status to disable Save & Reset buttons
resetForm({ values });
}
},
});

Expand Down

0 comments on commit f8aa016

Please sign in to comment.