From af4fe4d398bf5df1b64084bbc86435b1d894cb8f Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 28 Nov 2023 20:54:01 +0800 Subject: [PATCH 1/3] add missing onyx subscription --- src/components/ReportActionItem/TaskView.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/TaskView.js b/src/components/ReportActionItem/TaskView.js index ac82f310f3f8..b01d656d9123 100644 --- a/src/components/ReportActionItem/TaskView.js +++ b/src/components/ReportActionItem/TaskView.js @@ -2,6 +2,7 @@ import lodashGet from 'lodash/get'; import PropTypes from 'prop-types'; import React, {useEffect} from 'react'; import {View} from 'react-native'; +import {withOnyx} from 'react-native-onyx'; import Checkbox from '@components/Checkbox'; import Hoverable from '@components/Hoverable'; import Icon from '@components/Icon'; @@ -27,6 +28,7 @@ import useThemeStyles from '@styles/useThemeStyles'; import * as Session from '@userActions/Session'; import * as Task from '@userActions/Task'; import CONST from '@src/CONST'; +import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; const propTypes = { @@ -185,4 +187,13 @@ function TaskView(props) { TaskView.propTypes = propTypes; TaskView.displayName = 'TaskView'; -export default compose(withWindowDimensions, withLocalize, withCurrentUserPersonalDetails)(TaskView); +export default compose( + withWindowDimensions, + withLocalize, + withCurrentUserPersonalDetails, + withOnyx({ + personalDetails: { + key: ONYXKEYS.PERSONAL_DETAILS_LIST, + }, + }), +)(TaskView); From 103781a3996b3de62c41db7a567b99067bc04d8a Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 28 Nov 2023 20:54:22 +0800 Subject: [PATCH 2/3] add owner account id to participant --- src/components/LHNOptionsList/LHNOptionsList.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/LHNOptionsList/LHNOptionsList.js b/src/components/LHNOptionsList/LHNOptionsList.js index 0d300c5e2179..987faf2b3120 100644 --- a/src/components/LHNOptionsList/LHNOptionsList.js +++ b/src/components/LHNOptionsList/LHNOptionsList.js @@ -117,7 +117,13 @@ function LHNOptionsList({ const transactionID = lodashGet(itemParentReportAction, ['originalMessage', 'IOUTransactionID'], ''); const itemTransaction = transactionID ? transactions[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`] : {}; const itemComment = draftComments[`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${reportID}`] || ''; - const participantsPersonalDetails = OptionsListUtils.getPersonalDetailsForAccountIDs(itemFullReport.participantAccountIDs, personalDetails); + const participants = [...(itemFullReport.participantAccountIDs || [])]; + + if (itemFullReport.ownerAccountID > 0) { + participants.push(itemFullReport.ownerAccountID); + } + + const participantsPersonalDetails = OptionsListUtils.getPersonalDetailsForAccountIDs(participants, personalDetails); return ( Date: Fri, 1 Dec 2023 03:39:23 +0800 Subject: [PATCH 3/3] always include owner account id --- src/components/LHNOptionsList/LHNOptionsList.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/LHNOptionsList/LHNOptionsList.js b/src/components/LHNOptionsList/LHNOptionsList.js index 987faf2b3120..cee68be23a00 100644 --- a/src/components/LHNOptionsList/LHNOptionsList.js +++ b/src/components/LHNOptionsList/LHNOptionsList.js @@ -117,11 +117,7 @@ function LHNOptionsList({ const transactionID = lodashGet(itemParentReportAction, ['originalMessage', 'IOUTransactionID'], ''); const itemTransaction = transactionID ? transactions[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`] : {}; const itemComment = draftComments[`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${reportID}`] || ''; - const participants = [...(itemFullReport.participantAccountIDs || [])]; - - if (itemFullReport.ownerAccountID > 0) { - participants.push(itemFullReport.ownerAccountID); - } + const participants = [...(itemFullReport.participantAccountIDs || []), itemFullReport.ownerAccountID]; const participantsPersonalDetails = OptionsListUtils.getPersonalDetailsForAccountIDs(participants, personalDetails);