Skip to content

Commit

Permalink
don't show map if there is no data
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Jul 28, 2024
1 parent 927e54d commit b82d480
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/components/blocks/unique/map/map.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
const currentUserLink: Writable<MapLink> = writable(undefined);
const monitorMapPoints: Writable<MapPoint[]> = writable([]);
const monitorLinks: Writable<MapLink[]> = writable([]);
const hasMonitorData = writable(false);
let dd: DD | undefined = { lat: 0, lon: 0 }
let data: Writable<MapData<MapArea, MapPoint, MapLink>> = writable({ areas: [] as MapArea[], points: [] as MapPoint[], links: [] as MapLink[] })
Expand All @@ -76,6 +77,8 @@
}
const setRelayMapPoint = async(): void => {
if(!$MRP?.dd?.lat) return
hasMonitorData.set(true)
relayMapPoint.set({
id: 'relay',
latitude: $MRP.dd.lat,
Expand Down Expand Up @@ -204,7 +207,7 @@
>

</Geolocation>
{#if $MRP.nostr.monitors.isComplete}
{#if $MRP.nostr.monitors.isComplete && $MRP.nostr.monitors.monitorEvents.size && $hasMonitorData}
<Block class="relative pt-0" headingClass="py-5 absolute top w-full mb-2" {key}>
<svelte:fragment slot="title">
geo
Expand Down

0 comments on commit b82d480

Please sign in to comment.