diff --git a/src/renderers/Form/index.tsx b/src/renderers/Form/index.tsx index 227904e41..f1c0ac12a 100644 --- a/src/renderers/Form/index.tsx +++ b/src/renderers/Form/index.tsx @@ -562,17 +562,16 @@ export default class Form extends React.Component { if (onFinished && onFinished(values, action) === false) { return values; } - + + resetAfterSubmit && store.reset(onReset); + clearPersistDataAfterSubmit && store.clearPersistData(); + if (action.redirect || redirect) { env.updateLocation(filter(action.redirect || redirect, store.data)); } else if (action.reload || reload) { this.reloadTarget(action.reload || reload, store.data); } - resetAfterSubmit && store.reset(onReset); - - clearPersistDataAfterSubmit && store.clearPersistData(); - return values; }) .catch(reason => { diff --git a/src/store/form.ts b/src/store/form.ts index 5f5d014be..b079484d3 100644 --- a/src/store/form.ts +++ b/src/store/form.ts @@ -402,7 +402,6 @@ export const FormStore = ServiceStore function getPersistData() { self.persistData = true; let data = localStorage.getItem(location.pathname + self.path); - if (data) { self.updateData(JSON.parse(data)); }