# HG changeset patch # User Markus Kottlaender # Date 1557853257 -7200 # Node ID 276fde700aa6fd2a1490dc2e6a7ae8b3cc4e6e33 # Parent 97bd458acf0e69f73654242dd7d6a70fcf09187b client: import stretches: shortened code a bit diff -r 97bd458acf0e -r 276fde700aa6 client/src/components/ImportStretches.vue --- a/client/src/components/ImportStretches.vue Tue May 14 18:57:12 2019 +0200 +++ b/client/src/components/ImportStretches.vue Tue May 14 19:00:57 2019 +0200 @@ -366,14 +366,13 @@ }, watch: { identifiedFeatures() { - const filterDistanceMarks = x => { - return /^distance_marks_geoserver/.test(x["id_"]); - }; - const distanceMark = this.identifiedFeatures.filter(filterDistanceMarks); - if (distanceMark.length > 0) { - const value = distanceMark[0].getProperties()["location"]; - this.startrhm = this.pipetteStart ? value : this.startrhm; - this.endrhm = this.pipetteEnd ? value : this.endrhm; + const distanceMark = this.identifiedFeatures.find(x => + /^distance_marks_geoserver/.test(x["id_"]) + ); + if (distanceMark) { + const location = distanceMark.get("location"); + this.startrhm = this.pipetteStart ? location : this.startrhm; + this.endrhm = this.pipetteEnd ? location : this.endrhm; this.pipetteStart = false; this.pipetteEnd = false; }