added sounds, updated nped config and tweaks + code quality improvements

This commit is contained in:
2025-09-23 13:03:54 +01:00
parent eab7e79d01
commit c2074f86a2
27 changed files with 224 additions and 139 deletions

View File

@@ -13,6 +13,7 @@ import HotListImg from "/Hotlist_Hit.svg";
import NPED_CAT_A from "/NPED_Cat_A.svg";
import NPED_CAT_B from "/NPED_Cat_B.svg";
import NPED_CAT_C from "/NPED_Cat_C.svg";
import popup from "../../assets/sounds/ui/popup_open.mp3";
import { useSound } from "react-sounds";
function useNow(tickMs = 1000) {
@@ -38,7 +39,7 @@ export default function SightingHistoryWidget({
title,
}: SightingHistoryProps) {
useNow(1000);
const { play } = useSound("notification/notification");
const { play } = useSound(popup);
const {
sightings,
setSelectedSighting,
@@ -72,14 +73,13 @@ export default function SightingHistoryWidget({
const isNPEDHitC = obj?.metadata?.npedJSON?.["NPED CATEGORY"] === "C";
if (isNPEDHitA || isNPEDHitB || isNPEDHitC) {
play();
dispatch({
type: "ADD",
payload: obj,
});
}
});
}, [rows, dispatch, play]);
}, [dispatch, rows]);
useEffect(() => {
if (hasAutoOpenedRef.current) return;