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
@ -81,7 +81,7 @@ export const Layer = ({
|
|||||||
|
|
||||||
const isGroupTypeVisible = useIsGroupTypeVisible();
|
const isGroupTypeVisible = useIsGroupTypeVisible();
|
||||||
|
|
||||||
const visibleGroupTypes = useVisibleGroupType();
|
const visibleGroupTypes = useVisibleGroupType();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -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);
|
||||||
window.history.pushState({}, "", `/${item.id}` + `${params.toString() !== "" ? `?${params}` : ""}`)
|
if (!location.pathname.includes("/item/")) {
|
||||||
|
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);
|
||||||
@ -151,7 +153,7 @@ export const Layer = ({
|
|||||||
filter(item =>
|
filter(item =>
|
||||||
filterTags.length == 0 ? item : filterTags.some(tag => getItemTags(item).some(filterTag => filterTag.name.toLocaleLowerCase() === tag.name.toLocaleLowerCase())))?.
|
filterTags.length == 0 ? item : filterTags.some(tag => getItemTags(item).some(filterTag => filterTag.name.toLocaleLowerCase() === tag.name.toLocaleLowerCase())))?.
|
||||||
filter(item => item.layer && isLayerVisible(item.layer)).
|
filter(item => item.layer && isLayerVisible(item.layer)).
|
||||||
filter(item => item.group_type && isGroupTypeVisible(item.group_type)|| visibleGroupTypes.length == 0).
|
filter(item => item.group_type && isGroupTypeVisible(item.group_type) || visibleGroupTypes.length == 0).
|
||||||
map((item: Item) => {
|
map((item: Item) => {
|
||||||
if (getValue(item, itemLongitudeField) && getValue(item, itemLatitudeField)) {
|
if (getValue(item, itemLongitudeField) && getValue(item, itemLatitudeField)) {
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user