fixed dispatch eslint errors

This commit is contained in:
PxlLoewe
2025-07-10 00:35:34 -07:00
parent eec72a51b8
commit a9a4f1617a
47 changed files with 396 additions and 185 deletions

View File

@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { HpgState } from "@repo/db";
import { cn } from "@repo/shared-components";
import { useQuery } from "@tanstack/react-query";
@@ -6,7 +7,6 @@ import { getConnectedAircraftsAPI } from "_querys/aircrafts";
import { getStationsAPI } from "_querys/stations";
import { Ambulance, FireExtinguisher, Radio, Siren } from "lucide-react";
import { useEffect, useState } from "react";
import { FieldValues } from "react-hook-form";
type MissionStationsSelectProps = {
selectedStations?: number[];
@@ -54,7 +54,6 @@ export function StationsSelect({
...(vehicleStates.hpgFireEngineState !== HpgState.NOT_REQUESTED || undefined ? ["FW"] : []),
...(vehicleStates.hpgPoliceState !== HpgState.NOT_REQUESTED || undefined ? ["POL"] : []),
]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [selectedStations, vehicleStates]);
// Helper to check if a station is a vehicle and its state is NOT_REQUESTED

View File

@@ -1,3 +1,4 @@
/* eslint-disable react-hooks/exhaustive-deps */
"use client";
import { useSession } from "next-auth/react";
import { useDispatchConnectionStore } from "../../../../../_store/dispatch/connectionStore";
@@ -22,7 +23,6 @@ export const ConnectionBtn = () => {
const [logoffDebounce, setLogoffDebounce] = useState<NodeJS.Timeout | null>(null);
const session = useSession();
const uid = session.data?.user?.id;
if (!uid) return null;
// useEffect für die Logoff-Zeit
const [logoffHours, logoffMinutes] = form.logoffTime?.split(":").map(Number) || [];
@@ -58,7 +58,7 @@ export const ConnectionBtn = () => {
connection.disconnect();
};
}, [connection.disconnect]);
if (!uid) return null;
return (
<div className="rounded-box bg-base-200 flex justify-center items-center gap-2 p-1">
{connection.message.length > 0 && (

View File

@@ -1,8 +1,9 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
"use client";
import React, { useEffect } from "react";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { BellRing, BookmarkPlus, Radio } from "lucide-react";
import { BellRing, BookmarkPlus } from "lucide-react";
import { KEYWORD_CATEGORY, Mission, missionType, Prisma } from "@repo/db";
import {
JsonValueType,

View File

@@ -26,7 +26,14 @@ export const Pannel = () => {
setOpen(false);
}
}
}, [missions, setMissionFormValues, setEditingMission, setOpen, missionFormValues]);
}, [
missions,
setMissionFormValues,
setEditingMission,
setOpen,
missionFormValues,
editingMissionId,
]);
return (
<div className={cn("flex-1 max-w-[600px] z-9999999")}>

View File

@@ -1,4 +1,4 @@
import { ConnectedAircraft, Prisma } from "@repo/db";
import { Prisma } from "@repo/db";
import { usePilotConnectionStore } from "_store/pilot/connectionStore";
import { useMrtStore } from "_store/pilot/MrtStore";
import { pilotSocket } from "(app)/pilot/socket";
@@ -21,7 +21,7 @@ export const useButtons = () => {
}) => editConnectedAircraftAPI(aircraftId, data),
});
const { page, setPage } = useMrtStore((state) => state);
const { setPage } = useMrtStore((state) => state);
const handleButton =
(button: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "0" | "home") => () => {

View File

@@ -9,7 +9,6 @@ import { editConnectedAircraftAPI, getConnectedAircraftsAPI } from "_querys/airc
import { Prisma } from "@repo/db";
import { getNextDateWithTime } from "@repo/shared-components";
import { Select } from "_components/Select";
import { components } from "react-select";
import { Radio } from "lucide-react";
export const ConnectionBtn = () => {
@@ -54,7 +53,7 @@ export const ConnectionBtn = () => {
return () => {
connection.disconnect();
};
}, [connection.disconnect]);
}, [connection, connection.disconnect]);
const [logoffHours, logoffMinutes] = form.logoffTime?.split(":").map(Number) || [];
@@ -87,7 +86,7 @@ export const ConnectionBtn = () => {
return () => {
if (logoffDebounce) clearTimeout(logoffDebounce);
};
}, [logoffHours, logoffMinutes, connection.connectedAircraft]);
}, [logoffHours, logoffMinutes, connection.connectedAircraft, aircraftMutation, logoffDebounce]);
const session = useSession();
const uid = session.data?.user?.id;
@@ -143,7 +142,9 @@ export const ConnectionBtn = () => {
})
}
value={form.selectedStationId ?? ""}
formatOptionLabel={(option: any) => option.component}
formatOptionLabel={(option: unknown) =>
(option as { component: React.ReactNode }).component
}
options={
stations?.map((station) => ({
value: station.id.toString(),

View File

@@ -8,7 +8,7 @@ import dynamic from "next/dynamic";
import { ConnectedDispatcher } from "tracker/_components/ConnectedDispatcher";
import { useQuery } from "@tanstack/react-query";
import { usePilotConnectionStore } from "_store/pilot/connectionStore";
import { getAircraftsAPI, getConnectedAircraftsAPI } from "_querys/aircrafts";
import { getAircraftsAPI } from "_querys/aircrafts";
import { checkSimulatorConnected } from "@repo/shared-components";
import { SimConnectionAlert } from "(app)/pilot/_components/SimConnectionAlert";