This commit is contained in:
PxlLoewe
2025-05-24 12:47:09 -07:00
2 changed files with 15 additions and 11 deletions

View File

@@ -38,7 +38,7 @@ export const handleConnectDesktop = (socket: Socket, io: Server) => () => {
: user.publicId,
};
if (data.shouldTransmit) {
socket.to("pilots").emit("other-ptt", otherPttData);
socket.to("dispatchers").emit("other-ptt", otherPttData);
socket.to("pilots").emit("other-ptt", otherPttData);
}
});

View File

@@ -1,6 +1,6 @@
"use client";
import { useEffect, useRef, useState } from "react";
import { useEffect, useState } from "react";
import { usePilotConnectionStore } from "_store/pilot/connectionStore";
import {
Disc,
@@ -18,12 +18,10 @@ import { useAudioStore } from "_store/audioStore";
import { cn } from "helpers/cn";
import { ConnectionQuality } from "livekit-client";
import { ROOMS } from "_data/livekitRooms";
import { useSession } from "next-auth/react";
export const Audio = () => {
const connection = usePilotConnectionStore();
const [showSource, setShowSource] = useState(false);
const serverSession = useSession();
const {
isTalking,
@@ -41,12 +39,6 @@ export const Audio = () => {
useEffect(() => {
setShowSource(true);
const timeout = setTimeout(() => {
setShowSource(false);
}, 6000);
return () => {
clearTimeout(timeout);
};
}, [source, isTalking]);
useEffect(() => {
@@ -68,7 +60,19 @@ export const Audio = () => {
<>
<div className="bg-base-200 rounded-box flex items-center gap-2 p-1">
{state === "error" && <div className="h-4 flex items-center">{message}</div>}
{showSource && source && <div className="h-4 flex items-center ml-2">{source}</div>}
{showSource && source && (
<div
className="tooltip tooltip-left tooltip-error font-semibold"
data-tip="Funkspruch unterbrechen"
>
<button
className="btn btn-sm btn-soft border-none bg-transparent hover:bg-error"
onClick={() => {}}
>
{source}
</button>
</div>
)}
<button
onClick={() => {
if (state === "connected") toggleTalking();