diff --git a/modules/core/context.js b/modules/core/context.js index ad03eef3f..bb127b6d9 100644 --- a/modules/core/context.js +++ b/modules/core/context.js @@ -201,6 +201,13 @@ export function coreContext() { var canSave; if (mode && mode.id === 'save') { canSave = false; + + // Attempt to prevent user from creating duplicate changes - see #5200 + if (services.osm && services.osm.isChangesetInflight()) { + history.clearSaved(); + return; + } + } else { canSave = context.selectedIDs().every(function(id) { var entity = context.hasEntity(id); diff --git a/modules/services/osm.js b/modules/services/osm.js index 3b5121536..7579b6051 100644 --- a/modules/services/osm.js +++ b/modules/services/osm.js @@ -985,6 +985,11 @@ export default { }, + isChangesetInflight: function() { + return !!_changeset.inflight; + }, + + // get/set cached data // This is used to save/restore the state when entering/exiting the walkthrough // Also used for testing purposes.