Skip to content

Commit

Permalink
Merge pull request #57 from marmelab/fix/delete-avatar
Browse files Browse the repository at this point in the history
Fix(avatar): Avatar deletion is now persisted as expected
  • Loading branch information
jonathanarnault authored Aug 12, 2024
2 parents b861381 + 13d2e28 commit 1dbc5e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/misc/ImageEditorField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ const ImageEditorDialog = (props: ImageEditorDialogProps) => {
};

const deleteImage = () => {
setValue(props.source, undefined, { shouldDirty: true });
setValue(props.source, null, { shouldDirty: true });
if (props.onSave) {
handleSubmit(props.onSave)();
}
props.onClose();
};

Expand Down

0 comments on commit 1dbc5e7

Please sign in to comment.