Skip to content

Commit

Permalink
fix: correct ternary operator
Browse files Browse the repository at this point in the history
  • Loading branch information
daledah committed Aug 22, 2024
1 parent 1a59e4c commit a670ea1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libs/actions/Policy/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function getInvoicePrimaryWorkspace(activePolicyID?: OnyxEntry<string>): Policy
*/
function hasActiveChatEnabledPolicies(policies: Array<OnyxEntry<PolicySelector>> | OnyxCollection<PolicySelector>, includeOnlyAdminPolicies = false): boolean {
const chatEnabledPolicies = Object.values(policies ?? {}).filter(
(policy) => policy?.isPolicyExpenseChatEnabled && (!includeOnlyAdminPolicies ? policy.role === CONST.POLICY.ROLE.ADMIN : true),
(policy) => policy?.isPolicyExpenseChatEnabled && (!includeOnlyAdminPolicies || policy.role === CONST.POLICY.ROLE.ADMIN),
);

if (chatEnabledPolicies.length === 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ function FloatingActionButtonAndPopover(
},
]
: []),
...(!isLoading && !Policy.hasActiveChatEnabledPolicies(allPolicies, true)
...(!isLoading && !Policy.hasActiveChatEnabledPolicies(allPolicies)
? [
{
displayInDefaultIconColor: true,
Expand Down

0 comments on commit a670ea1

Please sign in to comment.