From b82d4802188ae2854212e7b98304dcab35e2c7bb Mon Sep 17 00:00:00 2001 From: dskvr Date: Sun, 28 Jul 2024 15:19:56 +0200 Subject: [PATCH] don't show map if there is no data --- src/lib/components/blocks/unique/map/map.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/components/blocks/unique/map/map.svelte b/src/lib/components/blocks/unique/map/map.svelte index f692d05..2c41e26 100644 --- a/src/lib/components/blocks/unique/map/map.svelte +++ b/src/lib/components/blocks/unique/map/map.svelte @@ -59,6 +59,7 @@ const currentUserLink: Writable = writable(undefined); const monitorMapPoints: Writable = writable([]); const monitorLinks: Writable = writable([]); + const hasMonitorData = writable(false); let dd: DD | undefined = { lat: 0, lon: 0 } let data: Writable> = writable({ areas: [] as MapArea[], points: [] as MapPoint[], links: [] as MapLink[] }) @@ -76,6 +77,8 @@ } const setRelayMapPoint = async(): void => { + if(!$MRP?.dd?.lat) return + hasMonitorData.set(true) relayMapPoint.set({ id: 'relay', latitude: $MRP.dd.lat, @@ -204,7 +207,7 @@ > -{#if $MRP.nostr.monitors.isComplete} +{#if $MRP.nostr.monitors.isComplete && $MRP.nostr.monitors.monitorEvents.size && $hasMonitorData} geo