diff --git a/src/app/containers/Settings/Settings.jsx b/src/app/containers/Settings/Settings.jsx index 30509461bb..03cd281bb7 100644 --- a/src/app/containers/Settings/Settings.jsx +++ b/src/app/containers/Settings/Settings.jsx @@ -115,14 +115,13 @@ class Settings extends PureComponent { }, // Workspace config: { - restoreDefaults: () => { - confirm({ + restoreDefaults: async () => { + await confirm({ title: i18n._('Reset All User Settings'), body: i18n._('Are you sure you want to restore the default settings?') - }).then(() => { - this.props.resetAllUserSettings(); - window.location.reload(); }); + await this.props.resetAllUserSettings(); + window.location.reload(); } }, // About diff --git a/src/app/flux/setting/index.js b/src/app/flux/setting/index.js index 0fd784667e..67a3d8b1b5 100644 --- a/src/app/flux/setting/index.js +++ b/src/app/flux/setting/index.js @@ -6,6 +6,17 @@ import { actions as projectActions } from '../project'; export const actions = { resetAllUserSettings: () => async (dispatch) => { + // macros + try { + let res = await api.macros.fetch(); + const { records: macros } = res.body; + for (const macro of macros) { + res = await api.macros.delete(macro.id); + } + } catch (err) { + //Ignore error + } + // api.removeElectronData(); dispatch(projectActions.cleanAllRecentFiles()); // remove recovery modelState