mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 20:42:34 +10:00
Compare commits
2 Commits
v1.3.0-rc.
...
bugfix-#71
| Author | SHA1 | Date | |
|---|---|---|---|
| 3eebd52dd1 | |||
| f8f4c07d11 |
@ -18,11 +18,12 @@ import {
|
|||||||
UserPlusIcon,
|
UserPlusIcon,
|
||||||
XMarkIcon,
|
XMarkIcon,
|
||||||
} from "@heroicons/react/24/outline";
|
} from "@heroicons/react/24/outline";
|
||||||
import { DocumentStatus, Document as PrismaDocument } from "@prisma/client";
|
import { DocumentStatus, Document as PrismaDocument, Recipient } from "@prisma/client";
|
||||||
import { FormProvider, useFieldArray, useForm, useWatch } from "react-hook-form";
|
import { FormProvider, useFieldArray, useForm, useWatch } from "react-hook-form";
|
||||||
|
import { toast } from "react-hot-toast";
|
||||||
|
|
||||||
export type FormValues = {
|
export type FormValues = {
|
||||||
signers: { id: number; email: string; name: string }[];
|
signers: Array<Pick<Recipient, 'id' | 'email' | 'name' | 'sendStatus'>>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const RecipientsPage: NextPageWithLayout = (props: any) => {
|
const RecipientsPage: NextPageWithLayout = (props: any) => {
|
||||||
@ -108,12 +109,14 @@ const RecipientsPage: NextPageWithLayout = (props: any) => {
|
|||||||
color="primary"
|
color="primary"
|
||||||
icon={PaperAirplaneIcon}
|
icon={PaperAirplaneIcon}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setOpen(true);
|
formValues.some((r) => r.email && hasEmailError(r))
|
||||||
|
? toast.error("Please enter a valid email address.", { id: "invalid email" })
|
||||||
|
: setOpen(true);
|
||||||
}}
|
}}
|
||||||
disabled={
|
disabled={
|
||||||
(formValues.length || 0) === 0 ||
|
(formValues.length || 0) === 0 ||
|
||||||
!formValues.some(
|
!formValues.some(
|
||||||
(r: any) => r.email && !hasEmailError(r) && r.sendStatus === "NOT_SENT"
|
(r) => r.email && !hasEmailError(r) && r.sendStatus === "NOT_SENT"
|
||||||
) ||
|
) ||
|
||||||
loading
|
loading
|
||||||
}>
|
}>
|
||||||
|
|||||||
Reference in New Issue
Block a user