mirror of
https://github.com/documenso/documenso.git
synced 2025-11-11 13:02:31 +10:00
🐛🚧
This commit is contained in:
@ -34,6 +34,12 @@ export default function PDFSigner(props: any) {
|
||||
|
||||
function onDialogClose(dialogResult: any) {
|
||||
// todo handle signature removed from field
|
||||
// todo remove free field if dialogresult is empty (or the id )
|
||||
if (!dialogResult && dialogField.type === "FREE_SIGNATURE") {
|
||||
onDeleteHandler(dialogField.id);
|
||||
return;
|
||||
}
|
||||
|
||||
const signature = {
|
||||
fieldId: dialogField.id,
|
||||
type: dialogResult.type,
|
||||
@ -194,7 +200,6 @@ export default function PDFSigner(props: any) {
|
||||
}
|
||||
|
||||
try {
|
||||
const deleted = toast.promise(
|
||||
fetch("/api/documents/" + 0 + "/fields/" + field.id, {
|
||||
method: "DELETE",
|
||||
headers: {
|
||||
@ -217,9 +222,7 @@ export default function PDFSigner(props: any) {
|
||||
style: {
|
||||
minWidth: "200px",
|
||||
},
|
||||
}
|
||||
);
|
||||
return deleted;
|
||||
};
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
@ -239,9 +242,9 @@ export default function PDFSigner(props: any) {
|
||||
return res.json();
|
||||
}),
|
||||
{
|
||||
loading: "Saving...",
|
||||
success: "Saved.",
|
||||
error: "Could not save :/",
|
||||
loading: "Adding...",
|
||||
success: "Added.",
|
||||
error: "Could not add :/",
|
||||
},
|
||||
{
|
||||
id: "saving field",
|
||||
|
||||
@ -102,7 +102,10 @@ export default function SignatureDialog(props: any) {
|
||||
<div className="float-right">
|
||||
<Button
|
||||
color="secondary"
|
||||
onClick={() => props.setOpen(false)}
|
||||
onClick={() => {
|
||||
props.onClose();
|
||||
props.setOpen(false);
|
||||
}}
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
@ -153,7 +156,10 @@ export default function SignatureDialog(props: any) {
|
||||
<div className="mt-10 float-right">
|
||||
<Button
|
||||
color="secondary"
|
||||
onClick={() => props.setOpen(false)}
|
||||
onClick={() => {
|
||||
props.onClose();
|
||||
props.setOpen(false);
|
||||
}}
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user