forked from MapComplete/MapComplete
Fix: add check that no changeset is opened without actually having changes
This commit is contained in:
parent
f2375f4877
commit
2843b01586
1 changed files with 14 additions and 0 deletions
|
@ -517,6 +517,17 @@ export class Changes {
|
||||||
...motivations,
|
...motivations,
|
||||||
...perBinMessage,
|
...perBinMessage,
|
||||||
]
|
]
|
||||||
|
{
|
||||||
|
const changes: {
|
||||||
|
newObjects: OsmObject[]
|
||||||
|
modifiedObjects: OsmObject[]
|
||||||
|
deletedObjects: OsmObject[]
|
||||||
|
} = self.CreateChangesetObjects(pending, objects);
|
||||||
|
if(changes.newObjects.length + changes.modifiedObjects.length + changes.deletedObjects.length === 0){
|
||||||
|
console.log("Not opening/uploading a changeset; seems like all changes are already applied")
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await this._changesetHandler.UploadChangeset(
|
await this._changesetHandler.UploadChangeset(
|
||||||
(csId, remappings) => {
|
(csId, remappings) => {
|
||||||
|
@ -525,11 +536,14 @@ export class Changes {
|
||||||
pending = pending.map((ch) => ChangeDescriptionTools.rewriteIds(ch, remappings))
|
pending = pending.map((ch) => ChangeDescriptionTools.rewriteIds(ch, remappings))
|
||||||
console.log("Result is", pending)
|
console.log("Result is", pending)
|
||||||
}
|
}
|
||||||
|
|
||||||
const changes: {
|
const changes: {
|
||||||
newObjects: OsmObject[]
|
newObjects: OsmObject[]
|
||||||
modifiedObjects: OsmObject[]
|
modifiedObjects: OsmObject[]
|
||||||
deletedObjects: OsmObject[]
|
deletedObjects: OsmObject[]
|
||||||
} = self.CreateChangesetObjects(pending, objects)
|
} = self.CreateChangesetObjects(pending, objects)
|
||||||
|
|
||||||
|
|
||||||
return Changes.createChangesetFor("" + csId, changes)
|
return Changes.createChangesetFor("" + csId, changes)
|
||||||
},
|
},
|
||||||
metatags,
|
metatags,
|
||||||
|
|
Loading…
Add table
Reference in a new issue