From efdff6335f5075f74156b5b1258ae69ab058705b Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 24 May 2023 02:16:04 +0200 Subject: [PATCH] Fix: stabilize change injector --- Logic/FeatureSource/Sources/ChangeGeometryApplicator.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Logic/FeatureSource/Sources/ChangeGeometryApplicator.ts b/Logic/FeatureSource/Sources/ChangeGeometryApplicator.ts index b0675c1bc5..5fd93fcd7e 100644 --- a/Logic/FeatureSource/Sources/ChangeGeometryApplicator.ts +++ b/Logic/FeatureSource/Sources/ChangeGeometryApplicator.ts @@ -6,6 +6,7 @@ import { UIEventSource } from "../../UIEventSource" import { FeatureSource, IndexedFeatureSource } from "../FeatureSource" import { ChangeDescription, ChangeDescriptionTools } from "../../Osm/Actions/ChangeDescription" import { Feature } from "geojson" +import {Utils} from "../../../Utils"; export default class ChangeGeometryApplicator implements FeatureSource { public readonly features: UIEventSource = new UIEventSource([]) @@ -69,6 +70,11 @@ export default class ChangeGeometryApplicator implements FeatureSource { // We only apply the last change as that one'll have the latest geometry const change = changesForFeature[changesForFeature.length - 1] copy.geometry = ChangeDescriptionTools.getGeojsonGeometry(change) + if(Utils.SameObject(copy.geometry, feature.geometry)){ + // No actual changes: pass along the original + newFeatures.push(feature) + continue + } console.log( "Applying a geometry change onto:", feature,