From b9d5e0b452375bf4e37271d78d44285635531964 Mon Sep 17 00:00:00 2001 From: Russ Garrett Date: Sun, 12 May 2024 17:32:33 +0100 Subject: [PATCH] Don't show village add button if there are no villages to add --- web/src/villages/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/villages/index.ts b/web/src/villages/index.ts index eaf6cb4..7144eb3 100644 --- a/web/src/villages/index.ts +++ b/web/src/villages/index.ts @@ -88,7 +88,9 @@ class VillagesLayer { this._user_id = json.id this.villages = await villages_response.json() - setStyle(this._wrapper, 'display', 'block') + if (this.villages && this.villages.length > 0) { + setStyle(this._wrapper, 'display', 'block') + } } onAdd(map: maplibregl.Map) {