|
|
@@ -39,6 +39,7 @@ import DateHoursList from "../DateHoursTable/DateHoursList"; |
|
|
|
import TimeLeaveInputTable from "./TimeLeaveInputTable"; |
|
|
|
import TimeLeaveMobileEntry from "./TimeLeaveMobileEntry"; |
|
|
|
import { Task } from "@/app/api/tasks"; |
|
|
|
import waitForCondition from "../utils/waitFor"; |
|
|
|
|
|
|
|
interface Props { |
|
|
|
isOpen: boolean; |
|
|
@@ -240,9 +241,14 @@ const TimeLeaveModal: React.FC<Props> = ({ |
|
|
|
<Button |
|
|
|
variant="contained" |
|
|
|
startIcon={<Check />} |
|
|
|
type="submit" |
|
|
|
onClick={() => { |
|
|
|
onClick={async () => { |
|
|
|
await waitForCondition(async () => { |
|
|
|
return !Object.values(formProps.formState.errors).some( |
|
|
|
(err) => err?.type === "custom", |
|
|
|
); |
|
|
|
}); |
|
|
|
formProps.clearErrors(); |
|
|
|
formProps.handleSubmit(onSubmit)(); |
|
|
|
}} |
|
|
|
> |
|
|
|
{t("Save")} |
|
|
|