From 69abfa4d424a9aed2651c03b945d173d3100bc74 Mon Sep 17 00:00:00 2001 From: I Nyoman Jyotisa Date: Thu, 4 Jul 2024 21:36:11 +0800 Subject: [PATCH 1/2] fix: filter out the receiver policy --- src/libs/PolicyUtils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/PolicyUtils.ts b/src/libs/PolicyUtils.ts index 5bd496ab9d39..97244c31a1ed 100644 --- a/src/libs/PolicyUtils.ts +++ b/src/libs/PolicyUtils.ts @@ -142,7 +142,8 @@ function shouldShowPolicy(policy: OnyxEntry, isOffline: boolean): boolea return ( !!policy && (policy?.type !== CONST.POLICY.TYPE.PERSONAL || !!policy?.isJoinRequestPending) && - (isOffline || policy?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || Object.keys(policy.errors ?? {}).length > 0) + (isOffline || policy?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || Object.keys(policy.errors ?? {}).length > 0) && + !!policy?.role ); } From 124e435e4f95be132e21b7fc090aee1eb79a636b Mon Sep 17 00:00:00 2001 From: I Nyoman Jyotisa Date: Thu, 4 Jul 2024 23:00:45 +0800 Subject: [PATCH 2/2] lint --- src/libs/PolicyUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/PolicyUtils.ts b/src/libs/PolicyUtils.ts index 97244c31a1ed..c9a34a98e2e2 100644 --- a/src/libs/PolicyUtils.ts +++ b/src/libs/PolicyUtils.ts @@ -143,7 +143,7 @@ function shouldShowPolicy(policy: OnyxEntry, isOffline: boolean): boolea !!policy && (policy?.type !== CONST.POLICY.TYPE.PERSONAL || !!policy?.isJoinRequestPending) && (isOffline || policy?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || Object.keys(policy.errors ?? {}).length > 0) && - !!policy?.role + !!policy?.role ); }