StationStatus Toast hinzugefügt #45
This commit is contained in:
@@ -29,4 +29,18 @@ export interface AdminMessage {
|
||||
};
|
||||
}
|
||||
|
||||
export type NotificationPayload = ValidationFailed | ValidationSuccess | AdminMessage;
|
||||
export interface StationStatus {
|
||||
type: "station-status";
|
||||
status: "5";
|
||||
message: string;
|
||||
data?: {
|
||||
stationId: number;
|
||||
aircraftId: number;
|
||||
};
|
||||
}
|
||||
|
||||
export type NotificationPayload =
|
||||
| ValidationFailed
|
||||
| ValidationSuccess
|
||||
| AdminMessage
|
||||
| StationStatus;
|
||||
|
||||
@@ -17,7 +17,7 @@ export const PenaltyDropdown = ({
|
||||
btnTip?: string;
|
||||
Icon: ReactNode;
|
||||
}) => {
|
||||
const [open, setOpen] = useState(true);
|
||||
const [open, setOpen] = useState(false);
|
||||
const [reason, setReason] = useState("");
|
||||
const [until, setUntil] = useState<string>("default");
|
||||
return (
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from "./cn";
|
||||
export * from "./event";
|
||||
export * from "./dates";
|
||||
export * from "./simulatorConnected";
|
||||
|
||||
7
packages/shared-components/helper/simulatorConnected.ts
Normal file
7
packages/shared-components/helper/simulatorConnected.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { ConnectedAircraft } from "@repo/db";
|
||||
|
||||
export const checkSimulatorConnected = (a: ConnectedAircraft) => {
|
||||
if (!a.lastHeartbeat || Date.now() - new Date(a.lastHeartbeat).getTime() > 30_000) return false; // 30 seconds
|
||||
if (!a.posLat || !a.posLng) return false;
|
||||
return true;
|
||||
};
|
||||
Reference in New Issue
Block a user