mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-17 22:24:49 +02:00
Attempt to prevent users from uploading duplicate changes
(closes #5200) This removes a users changes stored in localStorage if they try to close iD while an upload is in progress. It prevents the possiblity that the changeset is eventually accepted and closed, but the user can be prompted to restore those changes the next time they start iD.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user