Skip to content

Commit

Permalink
Merge pull request #51631 from bernhardoj/fix/51000-pending-join-work…
Browse files Browse the repository at this point in the history
…space-is-not-visible

Fix pending join workspace isn't visible in the WS list
  • Loading branch information
neil-marcellini authored Nov 7, 2024
2 parents d203c4d + eb239ca commit 7f6169a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,11 @@ function getPolicyRole(policy: OnyxInputOrEntry<Policy>, currentUserLogin: strin
*/
function shouldShowPolicy(policy: OnyxEntry<Policy>, 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))
);
}

Expand Down

0 comments on commit 7f6169a

Please sign in to comment.