diff --git a/src/libs/PolicyUtils.js b/src/libs/PolicyUtils.js index 582271d6610e..164f284a4ef5 100644 --- a/src/libs/PolicyUtils.js +++ b/src/libs/PolicyUtils.js @@ -10,7 +10,7 @@ import ONYXKEYS from '../ONYXKEYS'; * @returns {Array} */ function getActivePolicies(policies) { - return _.filter(policies, (policy) => policy && policy.type === CONST.POLICY.TYPE.FREE && policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE); + return _.filter(policies, (policy) => policy && policy.isPolicyExpenseChatEnabled && policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE); } /** @@ -86,7 +86,7 @@ function getPolicyBrickRoadIndicatorStatus(policy, policyMembersCollection) { function shouldShowPolicy(policy, isOffline) { return ( policy && - policy.type === CONST.POLICY.TYPE.FREE && + policy.isPolicyExpenseChatEnabled && policy.role === CONST.POLICY.ROLE.ADMIN && (isOffline || policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || !_.isEmpty(policy.errors)) ); diff --git a/src/libs/actions/Policy.js b/src/libs/actions/Policy.js index 809491c14950..b7542b160fb1 100644 --- a/src/libs/actions/Policy.js +++ b/src/libs/actions/Policy.js @@ -933,6 +933,7 @@ function createWorkspace(policyOwnerEmail = '', makeMeAdmin = false, policyName name: workspaceName, role: CONST.POLICY.ROLE.ADMIN, owner: sessionEmail, + isPolicyExpenseChatEnabled: true, outputCurrency: lodashGet(allPersonalDetails, [sessionAccountID, 'localCurrencyCode'], CONST.CURRENCY.USD), pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, customUnits, diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js index e692e4668f07..abade067f4fc 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js @@ -36,6 +36,7 @@ const policySelector = (policy) => policy && { type: policy.type, role: policy.role, + isPolicyExpenseChatEnabled: policy.isPolicyExpenseChatEnabled, pendingAction: policy.pendingAction, };