Fix lougout-Zeit
This commit is contained in:
@@ -54,8 +54,6 @@ export const ConnectionBtn = () => {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [connection.disconnect]);
|
||||
|
||||
const [logoffHours, logoffMinutes] = form.logoffTime?.split(":").map(Number) || [];
|
||||
|
||||
const { data: connectedAircrafts } = useQuery({
|
||||
queryKey: ["aircrafts"],
|
||||
queryFn: () => getConnectedAircraftsAPI(),
|
||||
@@ -182,11 +180,15 @@ export const ConnectionBtn = () => {
|
||||
className="btn"
|
||||
onClick={async () => {
|
||||
if (!connection.connectedAircraft) return;
|
||||
const [logoffHours, logoffMinutes] =
|
||||
form.logoffTime?.split(":").map(Number) || [];
|
||||
|
||||
console.log(logoffHours, logoffMinutes, form.logoffTime);
|
||||
await aircraftMutation.mutateAsync({
|
||||
sessionId: connection.connectedAircraft.id,
|
||||
change: {
|
||||
esimatedLogoutTime:
|
||||
logoffHours && logoffMinutes
|
||||
logoffHours !== undefined && logoffMinutes !== undefined
|
||||
? getNextDateWithTime(logoffHours, logoffMinutes)
|
||||
: null,
|
||||
},
|
||||
@@ -202,6 +204,7 @@ export const ConnectionBtn = () => {
|
||||
onSubmit={() => false}
|
||||
onClick={() => {
|
||||
connection.disconnect();
|
||||
modalRef.current?.close();
|
||||
}}
|
||||
>
|
||||
Verbindung Trennen
|
||||
|
||||
Reference in New Issue
Block a user