Merge branch 'main' of https://github.com/VAR-Virtual-Air-Rescue/var-monorepo
This commit is contained in:
@@ -38,7 +38,7 @@ export const handleConnectDesktop = (socket: Socket, io: Server) => () => {
|
|||||||
: user.publicId,
|
: user.publicId,
|
||||||
};
|
};
|
||||||
if (data.shouldTransmit) {
|
if (data.shouldTransmit) {
|
||||||
socket.to("pilots").emit("other-ptt", otherPttData);
|
socket.to("dispatchers").emit("other-ptt", otherPttData);
|
||||||
socket.to("pilots").emit("other-ptt", otherPttData);
|
socket.to("pilots").emit("other-ptt", otherPttData);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { usePilotConnectionStore } from "_store/pilot/connectionStore";
|
import { usePilotConnectionStore } from "_store/pilot/connectionStore";
|
||||||
import {
|
import {
|
||||||
Disc,
|
Disc,
|
||||||
@@ -18,12 +18,10 @@ import { useAudioStore } from "_store/audioStore";
|
|||||||
import { cn } from "helpers/cn";
|
import { cn } from "helpers/cn";
|
||||||
import { ConnectionQuality } from "livekit-client";
|
import { ConnectionQuality } from "livekit-client";
|
||||||
import { ROOMS } from "_data/livekitRooms";
|
import { ROOMS } from "_data/livekitRooms";
|
||||||
import { useSession } from "next-auth/react";
|
|
||||||
|
|
||||||
export const Audio = () => {
|
export const Audio = () => {
|
||||||
const connection = usePilotConnectionStore();
|
const connection = usePilotConnectionStore();
|
||||||
const [showSource, setShowSource] = useState(false);
|
const [showSource, setShowSource] = useState(false);
|
||||||
const serverSession = useSession();
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
isTalking,
|
isTalking,
|
||||||
@@ -41,12 +39,6 @@ export const Audio = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setShowSource(true);
|
setShowSource(true);
|
||||||
const timeout = setTimeout(() => {
|
|
||||||
setShowSource(false);
|
|
||||||
}, 6000);
|
|
||||||
return () => {
|
|
||||||
clearTimeout(timeout);
|
|
||||||
};
|
|
||||||
}, [source, isTalking]);
|
}, [source, isTalking]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -68,7 +60,19 @@ export const Audio = () => {
|
|||||||
<>
|
<>
|
||||||
<div className="bg-base-200 rounded-box flex items-center gap-2 p-1">
|
<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>}
|
{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
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (state === "connected") toggleTalking();
|
if (state === "connected") toggleTalking();
|
||||||
|
|||||||
Reference in New Issue
Block a user