Skip to content

Commit

Permalink
fix: don't trigger mutation with an empty project overview
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieu-foucault committed Jun 9, 2022
1 parent 8e2bbfb commit 0e44e78
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions app/components/Form/ProjectForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,12 @@ const ProjectForm: React.FC<Props> = (props) => {
changeData: any,
changeStatus: "pending" | "staged"
) => {
const updatedFormData =
Object.keys(changeData).length === 0
? {}
: {
...revision.projectFormChange.newFormData,
...changeData,
};
// don't trigger a change if the form data is an empty object
if (Object.keys(changeData).length === 0) return;
const updatedFormData = {
...revision.projectFormChange.newFormData,
...changeData,
};

return new Promise((resolve, reject) =>
updateProjectFormChange({
Expand Down

0 comments on commit 0e44e78

Please sign in to comment.