diff --git a/frontend/src/email/EmailForm/useFormState.ts b/frontend/src/email/EmailForm/useFormState.ts index d45bea19e66761695244a5194d9499401aa162cf..7ce4808701aac6b28082d8b22aef99f389c9e5ba 100644 --- a/frontend/src/email/EmailForm/useFormState.ts +++ b/frontend/src/email/EmailForm/useFormState.ts @@ -184,6 +184,11 @@ const useFormState = ({ }) } + /** + * Resets the form state to the initial state. If the form was loaded from + * a draft, the draft will be discarded + * (currently, that means updating its values to the initial values). + */ const discardDraft = (notifyOnSuccess: boolean) => { setSenderAddress(teamAddress || '') setContent('') @@ -195,6 +200,7 @@ const useFormState = ({ setTemplate(undefined) if (!loadDraft) { + notify('Draft discarded') return }