diff --git a/app/src/components/RouteMap/RouteMapPopup.tsx b/app/src/components/RouteMap/RouteMapPopup.tsx index 37deae1b8..949eaa92d 100644 --- a/app/src/components/RouteMap/RouteMapPopup.tsx +++ b/app/src/components/RouteMap/RouteMapPopup.tsx @@ -1,5 +1,5 @@ import type { Chain, UID } from "../../api/types"; -import { RefObject, useContext, useRef, useState } from "react"; +import { RefObject, useContext, useState } from "react"; import RouteMap from "./RouteMap"; import { useTranslation } from "react-i18next"; import { @@ -55,21 +55,16 @@ export default function RouteMapPopup(props: { {props.isChainAdmin ? ( - +

{t("allowMapTitle")}

-

- {t( - "allowMapBody", - )} -

+

{t("allowMapBody")}

- +
) : null} diff --git a/frontend/src/components/react/components/RouteMap/RouteMap.tsx b/frontend/src/components/react/components/RouteMap/RouteMap.tsx index d576709f7..de4c893dd 100644 --- a/frontend/src/components/react/components/RouteMap/RouteMap.tsx +++ b/frontend/src/components/react/components/RouteMap/RouteMap.tsx @@ -261,18 +261,17 @@ interface SortedCoordinate extends RouteCoordinate { route_index: number; } -function getSortedCoordinates(chainUID: UID, route: UID[]) { - return routeCoordinates(chainUID).then((res) => { - const sortedCoords: SortedCoordinate[] = []; - for (let i = 0; i < route.length; i++) { - const user_uid = route[i]; - const coord = res.data.find((c) => c.user_uid === user_uid); - if (!coord) continue; - sortedCoords.push({ - ...coord, - route_index: i, - }); - } - return sortedCoords; - }); +async function getSortedCoordinates(chainUID: UID, route: UID[]) { + const res = await routeCoordinates(chainUID); + const sortedCoords: SortedCoordinate[] = []; + for (let i = 0; i < route.length; i++) { + const user_uid = route[i]; + const coord = res.data.find((c) => c.user_uid === user_uid); + if (!coord) continue; + sortedCoords.push({ + ...coord, + route_index: i, + }); + } + return sortedCoords; } diff --git a/frontend/src/components/react/components/RouteMap/RouteMapPopup.tsx b/frontend/src/components/react/components/RouteMap/RouteMapPopup.tsx index 7eb448713..900612e57 100644 --- a/frontend/src/components/react/components/RouteMap/RouteMapPopup.tsx +++ b/frontend/src/components/react/components/RouteMap/RouteMapPopup.tsx @@ -1,4 +1,4 @@ -import type { Chain, UID, User } from "../../../../api/types"; +import type { Chain, UID } from "../../../../api/types"; import { useRef, type MouseEvent, useState } from "react"; import RouteMap from "./RouteMap"; import { useTranslation } from "react-i18next"; diff --git a/frontend/src/components/react/pages/ChainMemberList.tsx b/frontend/src/components/react/pages/ChainMemberList.tsx index d50f04bbd..c1864f012 100644 --- a/frontend/src/components/react/pages/ChainMemberList.tsx +++ b/frontend/src/components/react/pages/ChainMemberList.tsx @@ -98,7 +98,6 @@ export default function ChainMemberList() { const [error, setError] = useState(""); const [selectedTable, setSelectedTable] = useState("route"); const addCopyAttributes = useToClipboard(); - const refQrCode = useRef(null); const refQrCodeDialog = useRef(null); const [openQrCode, setOpenQrCode] = useState(false); diff --git a/frontend/src/components/react/pages/FindChain.tsx b/frontend/src/components/react/pages/FindChain.tsx index ded213e6c..875c856f1 100644 --- a/frontend/src/components/react/pages/FindChain.tsx +++ b/frontend/src/components/react/pages/FindChain.tsx @@ -17,7 +17,6 @@ import { circleRadiusKm, useMapZoom, } from "../util/maps"; -import { Categories, Sizes } from "../../../api/enums"; import { addToastError } from "../../../stores/toast"; import { useStore } from "@nanostores/react"; import { $chains } from "../../../stores/chains";