From e28fa3e667e8a63ce7eca941858ab6f4e208971d Mon Sep 17 00:00:00 2001 From: LinaYahya Date: Thu, 12 Oct 2023 10:37:10 +0200 Subject: [PATCH] fix: check member exist for invitation instance --- .../item/sharing/TableRowPermissionRenderer.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/item/sharing/TableRowPermissionRenderer.tsx b/src/components/item/sharing/TableRowPermissionRenderer.tsx index 25653b4b4..e26ae460d 100644 --- a/src/components/item/sharing/TableRowPermissionRenderer.tsx +++ b/src/components/item/sharing/TableRowPermissionRenderer.tsx @@ -54,9 +54,16 @@ function TableRowPermissionRenderer< const onChangePermission: ItemMembershipSelectProps['onChange'] = (e) => { const value = e.target.value as PermissionLevel; // editing a parent's instance from a child should create a new instance + console.log({ + value, + instancePer: instance.permission, + instanceMem: instance?.member?.id, + currentMember: currentMember?.id, + }); if ( (value === PermissionLevel.Read || value === PermissionLevel.Write) && instance.permission === PermissionLevel.Admin && + instance?.member && instance?.member?.id === currentMember?.id ) { setOpen(true); @@ -65,6 +72,7 @@ function TableRowPermissionRenderer< if ( value === PermissionLevel.Read && instance.permission === PermissionLevel.Write && + instance?.member && instance?.member?.id === currentMember?.id ) { setOpen(true);