diff --git a/packages/webapp/src/containers/Dialog/withDialogActions.tsx b/packages/webapp/src/containers/Dialog/withDialogActions.tsx index 92017cddc..93f0f0737 100644 --- a/packages/webapp/src/containers/Dialog/withDialogActions.tsx +++ b/packages/webapp/src/containers/Dialog/withDialogActions.tsx @@ -7,8 +7,10 @@ export const mapStateToProps = (state, props) => { }; export const mapDispatchToProps = (dispatch) => ({ - openDialog: (name, payload) => dispatch({ type: t.OPEN_DIALOG, name, payload }), - closeDialog: (name, payload) => dispatch({ type: t.CLOSE_DIALOG, name, payload }), + openDialog: (name, payload) => + dispatch({ type: t.OPEN_DIALOG, name, payload }), + closeDialog: (name, payload) => + dispatch({ type: t.CLOSE_DIALOG, name, payload }), }); -export default connect(null, mapDispatchToProps); \ No newline at end of file +export default connect(null, mapDispatchToProps); diff --git a/packages/webapp/src/containers/Sales/Invoices/InvoiceForm/InvoiceForm.tsx b/packages/webapp/src/containers/Sales/Invoices/InvoiceForm/InvoiceForm.tsx index 68a2cdd7f..012604d28 100644 --- a/packages/webapp/src/containers/Sales/Invoices/InvoiceForm/InvoiceForm.tsx +++ b/packages/webapp/src/containers/Sales/Invoices/InvoiceForm/InvoiceForm.tsx @@ -31,6 +31,7 @@ import { defaultInvoice, transformErrors, transformValueToRequest, + resetFormState, } from './utils'; import { InvoiceNoSyncSettingsToForm } from './components'; @@ -119,10 +120,9 @@ function InvoiceForm({ history.push('/invoices'); } if (submitPayload.resetForm) { - resetForm(); + resetFormState({ resetForm, initialValues, values }); } }; - // Handle the request error. const onError = ({ response: { diff --git a/packages/webapp/src/containers/Sales/Invoices/InvoiceForm/InvoiceFormHeader.tsx b/packages/webapp/src/containers/Sales/Invoices/InvoiceForm/InvoiceFormHeader.tsx index f9927c53e..82f57a266 100644 --- a/packages/webapp/src/containers/Sales/Invoices/InvoiceForm/InvoiceFormHeader.tsx +++ b/packages/webapp/src/containers/Sales/Invoices/InvoiceForm/InvoiceFormHeader.tsx @@ -14,6 +14,19 @@ import { useInvoiceTotal } from './utils'; * Invoice form header section. */ function InvoiceFormHeader() { + return ( +