Skip to content

Commit

Permalink
fix pending join workspace isn't visible
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Oct 29, 2024
1 parent db592c9 commit eb239ca
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 @@ -188,10 +188,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 eb239ca

Please sign in to comment.