Fix Logout time unable

This commit is contained in:
PxlLoewe
2025-07-19 13:07:23 -07:00
parent 41a3086d82
commit c10d7ef91a
4 changed files with 18 additions and 20 deletions

View File

@@ -48,7 +48,7 @@ export const handleConnectDispatch =
const connectedDispatcherEntry = await prisma.connectedDispatcher.create({
data: {
publicUser: getPublicUser(user) as any,
esimatedLogoutTime: logoffTime,
esimatedLogoutTime: logoffTime.length > 0 ? logoffTime : null,
lastHeartbeat: new Date().toISOString(),
userId: user.id,
zone: selectedZone,

View File

@@ -77,7 +77,7 @@ export const handleConnectPilot =
const connectedAircraftEntry = await prisma.connectedAircraft.create({
data: {
publicUser: getPublicUser(user) as any,
esimatedLogoutTime: logoffTime,
esimatedLogoutTime: logoffTime.length > 0 ? logoffTime : null,
userId: userId,
stationId: parseInt(stationId),
lastHeartbeat: debug ? nowPlus2h.toISOString() : undefined,

View File

@@ -61,8 +61,8 @@ const AircraftPopupContent = ({
return mission ? (
<MissionTab mission={mission} />
) : (
<div className="flex flex-col items-center justify-center min-h-full">
<span className="text-gray-500 my-10 font-semibold">Kein aktiver Einsatz</span>
<div className="flex min-h-full flex-col items-center justify-center">
<span className="my-10 font-semibold text-gray-500">Kein aktiver Einsatz</span>
</div>
);
case "chat":
@@ -77,7 +77,7 @@ const AircraftPopupContent = ({
return (
<>
<div
className="absolute p-1 z-99 top-0 right-0 transform -translate-y-full bg-base-100 cursor-pointer"
className="z-99 bg-base-100 absolute right-0 top-0 -translate-y-full transform cursor-pointer p-1"
onClick={() => {
setOpenAircraftMarker({
open: [],
@@ -90,7 +90,7 @@ const AircraftPopupContent = ({
<div
className={cn(
"absolute w-[calc(100%+2px)] h-4 z-99", // As offset is 2px, we need to add 2px to the width
"z-99 absolute h-4 w-[calc(100%+2px)]", // As offset is 2px, we need to add 2px to the width
anchor.includes("left") ? "-left-[2px]" : "-right-[2px]",
anchor.includes("top") ? "-top-[2px]" : "-bottom-[2px]",
)}
@@ -111,13 +111,13 @@ const AircraftPopupContent = ({
/>
<div>
<div
className="flex gap-[2px] text-white pb-0.5 overflow-auto"
className="flex gap-[2px] overflow-auto pb-0.5 text-white"
style={{
backgroundColor: `${FMS_STATUS_TEXT_COLORS[aircraft.fmsStatus]}`,
}}
>
<div
className="px-3 flex justify-center items-center cursor-pointer"
className="flex cursor-pointer items-center justify-center px-3"
style={{
backgroundColor: `${FMS_STATUS_COLORS[aircraft.fmsStatus]}`,
borderBottom:
@@ -130,7 +130,7 @@ const AircraftPopupContent = ({
<House className="text-sm" />
</div>
<div
className="px-4 flex justify-center items-center cursor-pointer"
className="flex cursor-pointer items-center justify-center px-4"
style={{
backgroundColor: `${FMS_STATUS_COLORS[aircraft.fmsStatus]}`,
}}
@@ -145,7 +145,7 @@ const AircraftPopupContent = ({
<ChevronsRightLeft className="text-sm" />
</div>
<div
className="flex justify-center items-center text-5xl font-bold px-6 cursor-pointer"
className="flex cursor-pointer items-center justify-center px-6 text-5xl font-bold"
style={{
backgroundColor: `${FMS_STATUS_COLORS[aircraft.fmsStatus]}`,
borderBottom:
@@ -159,7 +159,7 @@ const AircraftPopupContent = ({
{aircraft.fmsStatus}
</div>
<div
className="cursor-pointer px-2 min-w-[130px]"
className="min-w-[130px] cursor-pointer px-2"
style={{
backgroundColor: `${FMS_STATUS_COLORS[aircraft.fmsStatus]}`,
borderBottom:
@@ -169,8 +169,8 @@ const AircraftPopupContent = ({
}}
onClick={() => handleTabChange("aircraft")}
>
<span className="text-white text-base font-medium truncate">
{aircraft.Station.bosCallsign.length > 16
<span className="truncate text-base font-medium text-white">
{aircraft.Station.bosCallsign.length > 15
? aircraft.Station.bosCallsignShort
: aircraft.Station.bosCallsign}
</span>
@@ -193,14 +193,14 @@ const AircraftPopupContent = ({
}}
onClick={() => handleTabChange("mission")}
>
<span className="text-white text-base font-medium">Einsatz</span>
<span className="text-base font-medium text-white">Einsatz</span>
<br />
<span className="text-white text-sm font-medium">
<span className="text-sm font-medium text-white">
{mission?.publicId || "kein Einsatz"}
</span>
</div>
<div
className="px-4 flex justify-center items-center cursor-pointer"
className="flex cursor-pointer items-center justify-center px-4"
style={{
backgroundColor: `${FMS_STATUS_COLORS[aircraft.fmsStatus]}`,
borderBottom:

View File

@@ -169,7 +169,6 @@ export const useAudioStore = create<TalkState>((set, get) => ({
const inputStream = await navigator.mediaDevices.getUserMedia({
audio: {
deviceId: get().settings.micDeviceId ?? undefined,
noiseSuppression: true,
},
});
@@ -184,9 +183,8 @@ export const useAudioStore = create<TalkState>((set, get) => ({
name: "radio-audio",
source: Track.Source.Microphone,
});
setTimeout(() => {
publishedTrack.mute();
}, 400);
await publishedTrack.mute();
set({ localRadioTrack: publishedTrack });
set({ state: "connected", room, message: null });