Skip to content

Commit

Permalink
Update shouldShowPolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuuszzzzz committed Dec 22, 2023
1 parent f4d5b1f commit c3378bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ function shouldShowPolicy(policy: OnyxEntry<Policy>, isOffline: boolean): boolea
return (
!!policy &&
policy?.isPolicyExpenseChatEnabled &&
policy?.role === CONST.POLICY.ROLE.ADMIN &&
(isOffline || policy?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || Object.keys(policy.errors ?? {}).length > 0)
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/WorkspaceSwitcherPage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react-hooks/exhaustive-deps */
import PropTypes from 'prop-types';
import React, {useCallback, useEffect, useMemo, useState} from 'react';
import {View} from 'react-native';
Expand Down Expand Up @@ -136,7 +137,7 @@ function WorkspaceSwitcherPage({policies, activeWorkspaceID}) {
}))
.sortBy((policy) => policy.text.toLowerCase())
.value(),
[policies, isOffline, getIndicatorTypeForPolicy, hasUnreadData],
[policies, getIndicatorTypeForPolicy, hasUnreadData],
);

const filteredUserWorkspaces = useMemo(() => _.filter(usersWorkspaces, (policy) => policy.text.toLowerCase().startsWith(searchTerm.toLowerCase())), [searchTerm, usersWorkspaces]);
Expand Down

0 comments on commit c3378bd

Please sign in to comment.