Fix unlisted markers being counted

This commit is contained in:
Lukas Rieger (Blue) 2024-01-14 10:05:00 +01:00
parent 6ce32c56dc
commit d6e4e69417
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2
1 changed files with 10 additions and 3 deletions

View File

@ -6,9 +6,9 @@
<SwitchHandle :on="markerSet.visible" v-if="markerSet.toggleable"/>
</div>
<div class="stats">
<div v-if="markerSet.markers.length > 0">
{{ markerSet.markers.length }}
{{ $t('markers.marker', markerSet.markers.length) }}
<div v-if="filteredMarkerCount > 0">
{{ filteredMarkerCount }}
{{ $t('markers.marker', filteredMarkerCount) }}
</div>
<div v-if="filteredMarkerSetCount > 0">
{{ filteredMarkerSetCount }}
@ -46,6 +46,13 @@ export default {
}
return count;
},
filteredMarkerCount() {
let count = 0;
for (let marker of this.markerSet.markers) {
if (marker.listed) count++;
}
return count;
},
label() {
if (this.markerSet.id === "bm-players") return this.$t("players.title");
return this.markerSet.label;