From b1dcaee565d7d06829ac25edae32875126f6f9b1 Mon Sep 17 00:00:00 2001 From: PxlLoewe <72106766+PxlLoewe@users.noreply.github.com> Date: Wed, 23 Jul 2025 18:06:14 -0700 Subject: [PATCH 01/19] Rufgruppe anzeige gefixed --- .../app/_components/map/_components/AircraftMarkerTabs.tsx | 2 +- apps/dispatch/app/api/position-log/route.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/dispatch/app/_components/map/_components/AircraftMarkerTabs.tsx b/apps/dispatch/app/_components/map/_components/AircraftMarkerTabs.tsx index 42c1fdf5..8a6a8ad9 100644 --- a/apps/dispatch/app/_components/map/_components/AircraftMarkerTabs.tsx +++ b/apps/dispatch/app/_components/map/_components/AircraftMarkerTabs.tsx @@ -245,7 +245,7 @@ const StationTab = ({ aircraft }: { aircraft: ConnectedAircraft & { Station: Sta })), ) || []; - const livekitUser = participants.find((p) => (p.attributes.userId = aircraft.userId)); + const livekitUser = participants.find((p) => p.attributes.userId === aircraft.userId); const lstName = useMemo(() => { if (!aircraft.posLng || !aircraft.posLat) return station.bosRadioArea; diff --git a/apps/dispatch/app/api/position-log/route.ts b/apps/dispatch/app/api/position-log/route.ts index 3b50dbcc..87891c70 100644 --- a/apps/dispatch/app/api/position-log/route.ts +++ b/apps/dispatch/app/api/position-log/route.ts @@ -64,6 +64,7 @@ export const PUT = async (req: Request) => { }, }); + // TODO: Position Runden if (activeAircraft.posLat === position.lat && activeAircraft.posLng === position.lng) { return Response.json({ message: "Position has not changed" }, { status: 200 }); } From 2af5325c6b9cf7adaf3a27a98f35186dc024c312 Mon Sep 17 00:00:00 2001 From: nocnico Date: Thu, 24 Jul 2025 03:24:24 +0200 Subject: [PATCH 02/19] Make new Chat message more visible #93 --- apps/dispatch/app/_components/left/Chat.tsx | 31 ++++++++++++++------ apps/dispatch/public/sounds/newChat.mp3 | Bin 0 -> 40704 bytes 2 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 apps/dispatch/public/sounds/newChat.mp3 diff --git a/apps/dispatch/app/_components/left/Chat.tsx b/apps/dispatch/app/_components/left/Chat.tsx index 21b0b177..d09a5ebf 100644 --- a/apps/dispatch/app/_components/left/Chat.tsx +++ b/apps/dispatch/app/_components/left/Chat.tsx @@ -2,7 +2,7 @@ import { ChatBubbleIcon, PaperPlaneIcon } from "@radix-ui/react-icons"; import { useLeftMenuStore } from "_store/leftMenuStore"; import { useSession } from "next-auth/react"; -import { Fragment, useEffect, useState } from "react"; +import { Fragment, useEffect, useState, useRef } from "react"; import { cn } from "@repo/shared-components"; import { asPublicUser } from "@repo/db"; import { useQuery } from "@tanstack/react-query"; @@ -30,6 +30,8 @@ export const Chat = () => { const [message, setMessage] = useState(""); const dispatcherConnected = useDispatchConnectionStore((state) => state.status === "connected"); const pilotConnected = usePilotConnectionStore((state) => state.status === "connected"); + const [someChat, setSomeChat] = useState(false); + const audioRef = useRef(null); const { data: dispatcher } = useQuery({ queryKey: ["dispatcher"], @@ -61,16 +63,27 @@ export const Chat = () => { } }, [btnActive, setChatOpen]); + useEffect(() => { + if (Object.values(chats).some((c) => c.notification)) { + setSomeChat(true); + if (audioRef.current) { + audioRef.current.volume = 0.5; + audioRef.current.play().catch(() => {}); + } + } else { + setSomeChat(false); + } + }, [chats]); + return (
+