Skip to content

Commit

Permalink
Fix: Remove environment when recovery being canceled (#979)
Browse files Browse the repository at this point in the history
  • Loading branch information
meiliang1123 authored Apr 26, 2021
1 parent 8092f1f commit a83f21b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app/containers/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class App extends PureComponent {
footer: (
<button
type="button"
className="btn sm-btn-default sm-btn-primary"
className="btn sm-btn-default sm-btn-large sm-btn-primary"
onClick={async () => {
await this.props.onRecovery(headType);
popupActions.close();
Expand All @@ -306,7 +306,10 @@ class App extends PureComponent {
{i18n._('Yes')}
</button>
),
onClose: () => { this.setState({ [keyRecoveringProject]: false }); }
onClose: () => {
this.setState({ [keyRecoveringProject]: false });
this.props.clearSavedEnvironment(headType);
}
});
}
} else if (this.state[keyRecoveringProject]) {
Expand Down Expand Up @@ -441,7 +444,8 @@ const mapDispatchToProps = (dispatch) => {
saveAsFile: (headType) => dispatch(projectActions.saveAsFile(headType)),
save: (headType, dialogOptions) => dispatch(projectActions.save(headType, dialogOptions)),
saveAndClose: (headType, opts) => dispatch(projectActions.saveAndClose(headType, opts)),
openProject: (headType, history) => dispatch(projectActions.open(headType, history)),
openProject: (file, history) => dispatch(projectActions.open(file, history)),
clearSavedEnvironment: (headType) => dispatch(projectActions.clearSavedEnvironment(headType)),
resetAllUserSettings: () => dispatch(settingActions.resetAllUserSettings())
};
};
Expand Down

0 comments on commit a83f21b

Please sign in to comment.