Fix: fix loading notes based on hash

This commit is contained in:
Pieter Vander Vennet 2025-05-12 12:47:39 +02:00
parent b22dcd58c5
commit cde7bf6d9a
2 changed files with 5 additions and 2 deletions

View file

@ -28,7 +28,7 @@
"_first_user_id:=get(feat)('comments')[0].uid",
"_is_import_note:=(() => {const lines = feat.properties['_first_comment'].split('\\n'); const matchesMapCompleteURL = lines.map(l => l.match(\".*https://mapcomplete.\\(osm.be|org\\)/\\([a-zA-Z_-]+\\)\\(.html\\).*#import\")); const matchedIndexes = matchesMapCompleteURL.map((doesMatch, i) => [doesMatch !== null, i]).filter(v => v[0]).map(v => v[1]); return matchedIndexes[0] })()"
],
"isShown": "_total_comments>0",
"isShown": "comments!=[]",
"minzoom": 7,
"title": {
"render": {

View file

@ -41,7 +41,10 @@ export class WithSelectedElementState extends UserMapFeatureswitchState {
const [osm_type, osm_id] = selected.properties.id.split("/")
const [lon, lat] = GeoOperations.centerpointCoordinates(selected)
const layer = this.theme.getMatchingLayer(selected.properties)
if (!layer.isNormal()) {
if (!layer) {
return
}
if (!layer?.isNormal()) {
return
}