mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
fix URL issue
This commit is contained in:
parent
7f8b1f065b
commit
2b4a2ae08f
@ -95,7 +95,9 @@ export const Layer = ({
|
|||||||
const item = Object.entries(leafletRefs).find(r => r[1].popup == e.popup)?.[1].item;
|
const item = Object.entries(leafletRefs).find(r => r[1].popup == e.popup)?.[1].item;
|
||||||
if (item?.layer?.name == name && window.location.pathname.split("/")[1] != item.id) {
|
if (item?.layer?.name == name && window.location.pathname.split("/")[1] != item.id) {
|
||||||
let params = new URLSearchParams(window.location.search);
|
let params = new URLSearchParams(window.location.search);
|
||||||
|
if (!location.pathname.includes("/item/")) {
|
||||||
window.history.pushState({}, "", `/${item.id}` + `${params.toString() !== "" ? `?${params}` : ""}`)
|
window.history.pushState({}, "", `/${item.id}` + `${params.toString() !== "" ? `?${params}` : ""}`)
|
||||||
|
}
|
||||||
let title = "";
|
let title = "";
|
||||||
if (item.name) title = item.name;
|
if (item.name) title = item.name;
|
||||||
else if (item.layer?.itemNameField) title = getValue(item, item.layer.itemNameField);
|
else if (item.layer?.itemNameField) title = getValue(item, item.layer.itemNameField);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user