Don't show `You have unsaved changes. Continue?` confirm popup on configuration save
@@ -75,6 +75,7 @@ export default class DetachedConfiguration extends localization.LocalizedReactCo
navigationBlockedListener;
navigationBlocker;
+ allowedNavigation;
state = {
configurationsListCollapsed: false,
@@ -396,7 +397,9 @@ export default class DetachedConfiguration extends localization.LocalizedReactCo
overriddenConfiguration: null
}, () => {
if (this.selectedConfigurationName !== configuration.name) {
- this.props.router.push(`/configuration/${this.props.configurationId}/${configuration.name}`);
+ this.allowedNavigation =
+ `/configuration/${this.props.configurationId}/${configuration.name}`;
+ this.props.router.push(this.allowedNavigation);
}
});
return true;
@@ -1050,7 +1053,8 @@ export default class DetachedConfiguration extends localization.LocalizedReactCo
this.navigationBlocker = null;
}, 0);
};
- if (this.configurationModified && !this.navigationBlocker) {
+ if (this.configurationModified && !this.navigationBlocker &&
+ location.pathname !== this.allowedNavigation) {
const cancel = () => {
if (this.props.history.getCurrentLocation().pathname !== locationBefore) {
this.props.history.replace(locationBefore);
