Fix lougout-Zeit

This commit is contained in:
PxlLoewe
2025-07-10 23:41:39 -07:00
parent 879c422366
commit 446391679c
6 changed files with 17 additions and 10 deletions

View File

@@ -22,9 +22,6 @@ export const ConnectionBtn = () => {
const session = useSession();
const uid = session.data?.user?.id;
// useEffect für die Logoff-Zeit
const [logoffHours, logoffMinutes] = form.logoffTime?.split(":").map(Number) || [];
useEffect(() => {
// Disconnect the socket when the component unmounts
return () => {
@@ -101,11 +98,13 @@ export const ConnectionBtn = () => {
className="btn"
onClick={async () => {
if (!connection.connectedDispatcher?.id) return;
const [logoffHours, logoffMinutes] =
form.logoffTime?.split(":").map(Number) || [];
await changeDispatcherMutation.mutateAsync({
id: connection.connectedDispatcher?.id,
data: {
esimatedLogoutTime:
logoffHours && logoffMinutes
logoffHours !== undefined && logoffMinutes !== undefined
? getNextDateWithTime(logoffHours, logoffMinutes)
: null,
},