Fix lougout-Zeit
This commit is contained in:
@@ -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,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user