Skip to content

Commit

Permalink
Don't add title to note marker if note has no visible comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nenad-vujicic committed Jan 30, 2025
1 parent 2a0ad8b commit 2831256
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/assets/javascripts/index/layers/notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ OSM.initializeNotesLayer = function (map) {
marker.setIcon(noteIcons[feature.properties.status]);
} else {
let title;
const description = feature.properties.comments[0];

if (description?.action === "opened") {
title = description.text;
if (feature.properties.comments.length > 0) {
const description = feature.properties.comments[0];

if (description?.action === "opened") {
title = description.text;
}
}

marker = L.marker(feature.geometry.coordinates.reverse(), {
Expand Down

0 comments on commit 2831256

Please sign in to comment.