From d8383dafba5362fb2f4fda8b260cb754e6db51a7 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Tue, 15 Oct 2024 10:45:10 +0200 Subject: [PATCH] fix: do not show browser counter when layer is empty or not loaded fix #2215 --- umap/static/umap/js/modules/browser.js | 1 + 1 file changed, 1 insertion(+) diff --git a/umap/static/umap/js/modules/browser.js b/umap/static/umap/js/modules/browser.js index 38c7b565..3ad28ea8 100644 --- a/umap/static/umap/js/modules/browser.js +++ b/umap/static/umap/js/modules/browser.js @@ -98,6 +98,7 @@ export default class Browser { datalayer.eachFeature((feature) => this.addFeature(feature, container)) const total = datalayer.count() + if (!total) return const current = container.querySelectorAll('li').length const count = total === current ? total : `${current}/${total}` const counter = DomUtil.create('span', 'datalayer-counter', headline)