From eb239ca05b89a155db680e9af6bc0f02709afc32 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 29 Oct 2024 14:39:53 +0800 Subject: [PATCH] fix pending join workspace isn't visible --- src/libs/PolicyUtils.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libs/PolicyUtils.ts b/src/libs/PolicyUtils.ts index 36e5ccef3308..dca5c9184b1c 100644 --- a/src/libs/PolicyUtils.ts +++ b/src/libs/PolicyUtils.ts @@ -188,10 +188,11 @@ function getPolicyRole(policy: OnyxInputOrEntry, currentUserLogin: strin */ function shouldShowPolicy(policy: OnyxEntry, isOffline: boolean, currentUserLogin: string | undefined): boolean { 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) && - !!getPolicyRole(policy, currentUserLogin) + !!policy?.isJoinRequestPending || + (!!policy && + policy?.type !== CONST.POLICY.TYPE.PERSONAL && + (isOffline || policy?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || Object.keys(policy.errors ?? {}).length > 0) && + !!getPolicyRole(policy, currentUserLogin)) ); }