From 2398efe5d064b85879c71c9cfc5c9a19d16d0ccd Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Mon, 8 Jan 2024 15:41:50 +0100 Subject: [PATCH] fix multiple currentUserPersonalDetails HOCs --- src/pages/workspace/WorkspacesListPage.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/pages/workspace/WorkspacesListPage.js b/src/pages/workspace/WorkspacesListPage.js index 18da46e0a32d..9b1ddde26490 100755 --- a/src/pages/workspace/WorkspacesListPage.js +++ b/src/pages/workspace/WorkspacesListPage.js @@ -111,7 +111,7 @@ function dismissWorkspaceError(policyID, pendingAction) { throw new Error('Not implemented'); } -function WorkspacesListPage({policies, allPolicyMembers, reimbursementAccount, currentUserPersonalDetails, reports}) { +function WorkspacesListPage({policies, allPolicyMembers, reimbursementAccount, reports}) { const theme = useTheme(); const styles = useThemeStyles(); const {translate} = useLocalize(); @@ -179,16 +179,15 @@ function WorkspacesListPage({policies, allPolicyMembers, reimbursementAccount, c title={keyTitle} menuItems={threeDotsMenuItems} workspaceIcon={item.icon} - ownerAccountID={currentUserPersonalDetails.accountID} + ownerAccountID={item.ownerAccountID} workspaceType={item.type} - currentUserPersonalDetails={currentUserPersonalDetails} layoutWidth={isSmallScreenWidth ? CONST.LAYOUT_WIDTH.NARROW : CONST.LAYOUT_WIDTH.WIDE} /> ); }, - [currentUserPersonalDetails, isSmallScreenWidth, styles.mb3, styles.mh5, styles.ph5, translate], + [isSmallScreenWidth, styles.mb3, styles.mh5, styles.ph5, translate], ); const listHeaderComponent = useCallback(() => { @@ -285,6 +284,7 @@ function WorkspacesListPage({policies, allPolicyMembers, reimbursementAccount, c reports: policy.reports, adminRoom: policyRooms[policy.id] ? policyRooms[policy.id].adminRoom : null, announceRoom: policyRooms[policy.id] ? policyRooms[policy.id].announceRoom : null, + ownerAccountID: policy.ownerAccountID, })) .sortBy((policy) => policy.title.toLowerCase()) .value(); @@ -389,5 +389,4 @@ export default compose( key: ONYXKEYS.COLLECTION.REPORT, }, }), - withCurrentUserPersonalDetails, )(WorkspacesListPage);