From 2795db6351fbb88678022ff8a0045fda2a437974 Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 14 Sep 2023 13:53:53 +0200 Subject: [PATCH] fix browser navigation --- src/Components/Map/Layer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Map/Layer.tsx b/src/Components/Map/Layer.tsx index 8dd3d1f0..d9998132 100644 --- a/src/Components/Map/Layer.tsx +++ b/src/Components/Map/Layer.tsx @@ -42,7 +42,7 @@ export const Layer = (props: LayerProps) => { useMapEvents({ popupopen: (e) => { const item = Object.entries(leafletRefs).find(r => r[1].popup == e.popup)?.[1].item; - if (item?.layer?.name == props.name) { + if (item?.layer?.name == props.name && window.location.pathname.split("/")[2] != item.id) { window.history.pushState({}, "", `/${props.name}/${item.id}`) document.title = document.title.split("-")[0] + " - " + item.name; document.querySelector('meta[property="og:title"]')?.setAttribute("content", item.name);