diff --git a/Logic/Osm/Actions/CreateNewWayAction.ts b/Logic/Osm/Actions/CreateNewWayAction.ts index 335227c0b0..68c521abc6 100644 --- a/Logic/Osm/Actions/CreateNewWayAction.ts +++ b/Logic/Osm/Actions/CreateNewWayAction.ts @@ -26,7 +26,22 @@ export default class CreateNewWayAction extends OsmCreateAction { theme: string }) { super(null, true) - this.coordinates = coordinates; + this.coordinates = []; + + for (const coordinate of coordinates) { + /* The 'PointReuseAction' is a bit buggy and might generate duplicate ids. + We filter those here, as the CreateWayWithPointReuseAction delegates the actual creation to here. + Filtering here also prevents similar bugs in other actions + */ + if(this.coordinates.length > 0 && this.coordinates[this.coordinates.length - 1].nodeId === coordinate.nodeId){ + // This is a duplicate id + console.warn("Skipping a node in createWay to avoid a duplicate node:", coordinate,"\nThe previous coordinates are: ", this.coordinates) + continue + } + + this.coordinates.push(coordinate) + } + this.tags = tags; this._options = options; } diff --git a/UI/Popup/AutoApplyButton.ts b/UI/Popup/AutoApplyButton.ts index 0f3f7c1c68..228f223b86 100644 --- a/UI/Popup/AutoApplyButton.ts +++ b/UI/Popup/AutoApplyButton.ts @@ -210,7 +210,6 @@ export default class AutoApplyButton implements SpecialVisualization { // Very ugly hack: read the value every 500ms UIEventSource.Chronic(500, () => to_parse.data === undefined).addCallback(() => { const applicable = tagSource.data[argument[1]] - console.log("Current applicable value is: ", applicable) to_parse.setData(applicable) })