Added working System config, NOT working WiFi & modem and Session pages as placeholders. Also added NPED images.
This commit is contained in:
@@ -4,7 +4,7 @@ import { useCallback, useEffect, useRef } from "react";
|
||||
async function fetchSighting() {
|
||||
const response = await fetch(
|
||||
// `http://100.82.205.44/api`
|
||||
`http://100.116.253.81/mergedHistory/sightingSummary?mostRecentRef=-1`
|
||||
`http://192.168.75.11/mergedHistory/sightingSummary?mostRecentRef=-1`
|
||||
);
|
||||
if (!response.ok) throw new Error("Failed to fetch sighting");
|
||||
return response.json();
|
||||
@@ -31,7 +31,7 @@ export function useLatestSighting() {
|
||||
const { data } = useQuery({
|
||||
queryKey: ["latestSighting"],
|
||||
queryFn: fetchSighting,
|
||||
refetchInterval: 500,
|
||||
refetchInterval: 100,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -45,6 +45,8 @@ export function useSightingFeed(url: string) {
|
||||
if (data.ref === lastSeenRef.current) return; // duplicate payload → do nothing
|
||||
lastSeenRef.current = data.ref;
|
||||
|
||||
setMostRecent(data);
|
||||
|
||||
setSightings((prev) => {
|
||||
const existing = prev.find((p) => p?.ref === data.ref);
|
||||
const next = existing
|
||||
@@ -59,7 +61,8 @@ export function useSightingFeed(url: string) {
|
||||
|
||||
return next;
|
||||
});
|
||||
setMostRecent(sightings[0]);
|
||||
// setMostRecent(sightings[0]);
|
||||
// setMostRecent(data);
|
||||
mostRecentRef.current = data.ref ?? -1;
|
||||
}, [data, selectedRef, sightings]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user