diff --git a/Logic/Osm/ChangesetHandler.ts b/Logic/Osm/ChangesetHandler.ts index 5b07a0faf..1861afa3a 100644 --- a/Logic/Osm/ChangesetHandler.ts +++ b/Logic/Osm/ChangesetHandler.ts @@ -50,6 +50,22 @@ export class ChangesetHandler { } + /** + * Creates a new list which contains every key at most once + */ + public static removeDuplicateMetaTags(extraMetaTags: ChangesetTag[]): ChangesetTag[]{ + const r : ChangesetTag[] = [] + const seen = new Set() + for (const extraMetaTag of extraMetaTags) { + if(seen.has(extraMetaTag.key)){ + continue + } + r.push(extraMetaTag) + seen.add(extraMetaTag.key) + } + return r + } + /** * Inplace rewrite of extraMetaTags * If the metatags contain a special motivation of the format ":node/-", this method will rewrite this negative number to the actual ID @@ -95,7 +111,7 @@ export class ChangesetHandler { } extraMetaTags = [...extraMetaTags, ...this.defaultChangesetTags()] - + extraMetaTags = ChangesetHandler.removeDuplicateMetaTags(extraMetaTags) if (this.userDetails.data.csCount == 0) { // The user became a contributor! this.userDetails.data.csCount = 1; @@ -316,6 +332,7 @@ export class ChangesetHandler { private async UpdateTags( csId: number, tags: ChangesetTag[]) { + tags = ChangesetHandler.removeDuplicateMetaTags(tags) console.trace("Updating tags of " + csId) const self = this; diff --git a/Models/Constants.ts b/Models/Constants.ts index d7cf889fb..6e0466d04 100644 --- a/Models/Constants.ts +++ b/Models/Constants.ts @@ -2,7 +2,7 @@ import {Utils} from "../Utils"; export default class Constants { - public static vNumber = "0.17.0-alpha-2"; + public static vNumber = "0.17.0-alpha-3"; public static ImgurApiKey = '7070e7167f0a25a' public static readonly mapillary_client_token_v4 = "MLY|4441509239301885|b40ad2d3ea105435bd40c7e76993ae85" diff --git a/assets/layers/charging_station/charging_station.json b/assets/layers/charging_station/charging_station.json index 6c05fa04b..9bde3a320 100644 --- a/assets/layers/charging_station/charging_station.json +++ b/assets/layers/charging_station/charging_station.json @@ -3370,18 +3370,6 @@ "nl": "Moet men betalen om dit oplaadpunt te gebruiken?" }, "mappings": [ - { - "if": { - "and": [ - "fee=no" - ] - }, - "then": { - "nl": "Gratis te gebruiken", - "en": "Free to use" - }, - "hideInAnswer": true - }, { "if": { "and": [ @@ -3410,6 +3398,18 @@ "en": "Free to use, but one has to authenticate" } }, + { + "if": { + "and": [ + "fee=no" + ] + }, + "then": { + "nl": "Gratis te gebruiken", + "en": "Free to use" + }, + "hideInAnswer": true + }, { "if": { "and": [ diff --git a/assets/layers/charging_station/charging_station.protojson b/assets/layers/charging_station/charging_station.protojson index 7c6d492ec..ad748caa2 100644 --- a/assets/layers/charging_station/charging_station.protojson +++ b/assets/layers/charging_station/charging_station.protojson @@ -224,18 +224,6 @@ "nl": "Moet men betalen om dit oplaadpunt te gebruiken?" }, "mappings": [ - { - "if": { - "and": [ - "fee=no" - ] - }, - "then": { - "nl": "Gratis te gebruiken", - "en": "Free to use" - }, - "hideInAnswer": true - }, { "if": { "and": [ @@ -264,6 +252,18 @@ "en": "Free to use, but one has to authenticate" } }, + { + "if": { + "and": [ + "fee=no" + ] + }, + "then": { + "nl": "Gratis te gebruiken", + "en": "Free to use" + }, + "hideInAnswer": true + }, { "if": { "and": [ diff --git a/langs/layers/en.json b/langs/layers/en.json index 5203d3866..472d18c56 100644 --- a/langs/layers/en.json +++ b/langs/layers/en.json @@ -1797,14 +1797,14 @@ "fee": { "mappings": { "0": { - "then": "Free to use" - }, - "1": { "then": "Free to use (without authenticating)" }, - "2": { + "1": { "then": "Free to use, but one has to authenticate" }, + "2": { + "then": "Free to use" + }, "3": { "then": "Paid use, but free for customers of the hotel/pub/hospital/... who operates the charging station" }, diff --git a/langs/layers/nl.json b/langs/layers/nl.json index 46bcd6691..b71c9de87 100644 --- a/langs/layers/nl.json +++ b/langs/layers/nl.json @@ -1806,14 +1806,14 @@ "fee": { "mappings": { "0": { - "then": "Gratis te gebruiken" - }, - "1": { "then": "Gratis te gebruiken (zonder aan te melden)" }, - "2": { + "1": { "then": "Gratis te gebruiken, maar aanmelden met een applicatie is verplicht" }, + "2": { + "then": "Gratis te gebruiken" + }, "3": { "then": "Betalend te gebruiken, maar gratis voor klanten van het bijhorende hotel/café/ziekenhuis/..." },