Update SimpleMetaTagger.ts

objectMetaInfo should return false if it does not change anything (e.g. if run on a non-OSM layer). Returning true  causes MetaTagging to execute state?.allElements?.getEventSourceById(feature.properties.id)?.ping() with is slow and makes MapComplete unresponsive in some themes.

Helps with #1094
This commit is contained in:
RobJN 2023-02-04 20:52:41 +00:00 committed by GitHub
parent c0cbfbcd87
commit 4b1fdc0e2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,6 +118,7 @@ export default class SimpleMetaTaggers {
/*Note: also called by 'UpdateTagsFromOsmAPI'*/
const tgs = feature.properties
let movedSomething = false;
function move(src: string, target: string) {
if (tgs[src] === undefined) {
@ -125,6 +126,7 @@ export default class SimpleMetaTaggers {
}
tgs[target] = tgs[src]
delete tgs[src]
movedSomething = true
}
move("user", "_last_edit:contributor")
@ -132,7 +134,7 @@ export default class SimpleMetaTaggers {
move("changeset", "_last_edit:changeset")
move("timestamp", "_last_edit:timestamp")
move("version", "_version_number")
return true
return movedSomething
}
)
public static country = new CountryTagger()