mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
delete ux
This commit is contained in:
@ -142,11 +142,17 @@ const RecipientsPage: NextPageWithLayout = (props: any) => {
|
|||||||
<div className="ml-auto flex">
|
<div className="ml-auto flex">
|
||||||
<IconButton
|
<IconButton
|
||||||
icon={XMarkIcon}
|
icon={XMarkIcon}
|
||||||
|
disabled={!item.id}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const signersWithoutIndex = [...signers];
|
const signersWithoutIndex = [...signers];
|
||||||
signersWithoutIndex.splice(index, 1);
|
const removedItem = signersWithoutIndex.splice(
|
||||||
|
index,
|
||||||
|
1
|
||||||
|
);
|
||||||
setSigners(signersWithoutIndex);
|
setSigners(signersWithoutIndex);
|
||||||
deleteRecipient(item);
|
deleteRecipient(item).catch((err) => {
|
||||||
|
setSigners(signersWithoutIndex.concat(removedItem));
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
className="group-hover:text-neon-dark group-hover:disabled:text-gray-400"
|
className="group-hover:text-neon-dark group-hover:disabled:text-gray-400"
|
||||||
></IconButton>
|
></IconButton>
|
||||||
@ -182,7 +188,7 @@ async function deleteRecipient(recipient: any) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = toast.promise(
|
return toast.promise(
|
||||||
fetch(
|
fetch(
|
||||||
"/api/documents/" + recipient.documentId + "/recipients/" + recipient.id,
|
"/api/documents/" + recipient.documentId + "/recipients/" + recipient.id,
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user