mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 12:32:34 +10:00
fix: handle unauthorized document move error (#1884)
This commit is contained in:
@ -127,6 +127,16 @@ export const DocumentMoveToFolderDialog = ({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (error.code === AppErrorCode.UNAUTHORIZED) {
|
||||||
|
toast({
|
||||||
|
title: _(msg`Error`),
|
||||||
|
description: _(msg`You are not allowed to move this document.`),
|
||||||
|
variant: 'destructive',
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: _(msg`Error`),
|
title: _(msg`Error`),
|
||||||
description: _(msg`An error occurred while moving the document.`),
|
description: _(msg`An error occurred while moving the document.`),
|
||||||
|
|||||||
@ -188,7 +188,7 @@ export const DocumentsTableActionDropdown = ({
|
|||||||
<Trans>Duplicate</Trans>
|
<Trans>Duplicate</Trans>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
|
|
||||||
{onMoveDocument && (
|
{onMoveDocument && canManageDocument && (
|
||||||
<DropdownMenuItem onClick={onMoveDocument} onSelect={(e) => e.preventDefault()}>
|
<DropdownMenuItem onClick={onMoveDocument} onSelect={(e) => e.preventDefault()}>
|
||||||
<FolderInput className="mr-2 h-4 w-4" />
|
<FolderInput className="mr-2 h-4 w-4" />
|
||||||
<Trans>Move to Folder</Trans>
|
<Trans>Move to Folder</Trans>
|
||||||
|
|||||||
Reference in New Issue
Block a user