From 9a879230fefa2554a84a99cf711ff59123e7921e Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Wed, 10 May 2023 16:59:33 +0200 Subject: [PATCH] Make sure to only list your own policy expense chats in the request money option --- src/libs/OptionsListUtils.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 5a2652a56580..66b38ab24e90 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -103,7 +103,10 @@ function getPolicyExpenseReportOptions(report) { if (!ReportUtils.isPolicyExpenseChat(report)) { return []; } - const filteredPolicyExpenseReports = _.filter(policyExpenseReports, (policyExpenseReport) => policyExpenseReport.policyID === report.policyID); + const filteredPolicyExpenseReports = _.filter( + policyExpenseReports, + (policyExpenseReport) => policyExpenseReport.policyID === report.policyID && policyExpenseReport.isOwnPolicyExpenseChat, + ); return _.map(filteredPolicyExpenseReports, (expenseReport) => { const policyExpenseChatAvatarSource = ReportUtils.getWorkspaceAvatar(expenseReport); return { @@ -195,7 +198,7 @@ function getPersonalDetailsForLogins(logins, personalDetails) { * @returns {boolean} */ function isPersonalDetailsReady(personalDetails) { - return !_.isEmpty(personalDetails) && !_.some(_.keys(personalDetails), key => !personalDetails[key].login); + return !_.isEmpty(personalDetails) && !_.some(_.keys(personalDetails), (key) => !personalDetails[key].login); } /**