From 047251756e4060f0c1a708aaf0922caf13924539 Mon Sep 17 00:00:00 2001 From: Toba Ojo Date: Fri, 19 Sep 2025 10:55:36 +0100 Subject: [PATCH] updated preview camera view and removed NPED alert disptach --- .env | 4 ++- .../SightingModal/SightingModal.tsx | 19 ++++++++------ .../SightingsWidget/SightingWidget.tsx | 26 +++++++++---------- src/hooks/useGetOverviewSnapshot.ts | 10 +++---- 4 files changed, 30 insertions(+), 29 deletions(-) diff --git a/.env b/.env index c640348..93a03e4 100644 --- a/.env +++ b/.env @@ -9,4 +9,6 @@ VITE_AGX_BOX_FRONT_URL=http://192.168.0.90:8080/SightingListFront/sightingSummar VITE_AGX_BOX_REAR_URL=http://192.168.0.90:8080/SightingListRear/sightingSummary?mostRecentRef= VITE_AGX=http://100.72.72.70:8080/SightingListRear/sightingSummary?mostRecentRef= -VITE_AGX_FRONT=http://100.72.72.70:8080/SightingListFront/sightingSummary?mostRecentRef= \ No newline at end of file +VITE_AGX_FRONT=http://100.72.72.70:8080/SightingListFront/sightingSummary?mostRecentRef= + +VITE_AGX_FRONT_BASE=http://100.72.72.70:8080/ \ No newline at end of file diff --git a/src/components/SightingModal/SightingModal.tsx b/src/components/SightingModal/SightingModal.tsx index 72cb3e9..8046ebf 100644 --- a/src/components/SightingModal/SightingModal.tsx +++ b/src/components/SightingModal/SightingModal.tsx @@ -43,18 +43,21 @@ const SightingModal = ({ Sighting Details -
- - plate patch +
+
+ + plate patch +
+ {isHotListHit && ( hotlistHit )}
diff --git a/src/components/SightingsWidget/SightingWidget.tsx b/src/components/SightingsWidget/SightingWidget.tsx index 383c8dc..479396e 100644 --- a/src/components/SightingsWidget/SightingWidget.tsx +++ b/src/components/SightingsWidget/SightingWidget.tsx @@ -7,7 +7,7 @@ import CardHeader from "../UI/CardHeader"; import clsx from "clsx"; import { useSightingFeedContext } from "../../context/SightingFeedContext"; import SightingModal from "../SightingModal/SightingModal"; -import { useAlertHitContext } from "../../context/AlertHitContext"; +// import { useAlertHitContext } from "../../context/AlertHitContext"; import InfoBar from "./InfoBar"; function useNow(tickMs = 1000) { @@ -44,7 +44,7 @@ export default function SightingHistoryWidget({ selectedSighting, } = useSightingFeedContext(); - const { dispatch } = useAlertHitContext(); + // const { dispatch } = useAlertHitContext(); const hasAutoOpenedRef = useRef(false); @@ -62,18 +62,18 @@ export default function SightingHistoryWidget({ [sightings] ); - useEffect(() => { - rows?.forEach((obj) => { - const isNPEDHit = obj?.metadata?.npedJSON?.status_code === 404; + // useEffect(() => { + // rows?.forEach((obj) => { + // const isNPEDHit = obj?.metadata?.npedJSON?.status_code === 404; - if (isNPEDHit) { - dispatch({ - type: "ADD", - payload: obj, - }); - } - }); - }, [rows, dispatch]); + // if (isNPEDHit) { + // dispatch({ + // type: "ADD", + // payload: obj, + // }); + // } + // }); + // }, [rows, dispatch]); useEffect(() => { if (hasAutoOpenedRef.current) return; diff --git a/src/hooks/useGetOverviewSnapshot.ts b/src/hooks/useGetOverviewSnapshot.ts index 707889c..9609caf 100644 --- a/src/hooks/useGetOverviewSnapshot.ts +++ b/src/hooks/useGetOverviewSnapshot.ts @@ -1,14 +1,10 @@ import { useRef, useCallback, useEffect } from "react"; import { useQuery } from "@tanstack/react-query"; -const apiUrl = import.meta.env.VITE_BASEURL; -const folkstoneUrl = import.meta.env.VITE_FOLKESTONE_BASE; -console.log(folkstoneUrl); +const apiUrl = import.meta.env.VITE_AGX_FRONT_BASE; + async function fetchSnapshot(cameraSide: string) { - const response = await fetch( - // `${folkstoneUrl}/Colour-preview` - `${apiUrl}/${cameraSide}-preview` - ); + const response = await fetch(`${apiUrl}/${cameraSide}-preview`); if (!response.ok) { throw new Error("Cannot reach endpoint"); }