From 6d9c8e821d9ba8a93790a2e4d59e76f1d8322c3f Mon Sep 17 00:00:00 2001
From: Tim Golen <tgolen@expensify.com>
Date: Fri, 2 Dec 2022 10:49:36 -0700
Subject: [PATCH 1/4] Correct the logic for when bill split particpants can be
 selected

---
 src/components/IOUConfirmationList.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/components/IOUConfirmationList.js b/src/components/IOUConfirmationList.js
index 4f4eb415ed4b..36cfa27f644e 100755
--- a/src/components/IOUConfirmationList.js
+++ b/src/components/IOUConfirmationList.js
@@ -275,7 +275,11 @@ class IOUConfirmationList extends Component {
         const shouldShowSettlementButton = this.props.iouType === CONST.IOU.IOU_TYPE.SEND;
         const shouldDisableButton = selectedParticipants.length === 0;
         const recipient = this.state.participants[0];
-        const canModifyParticipants = !this.props.isIOUAttachedToExistingChatReport && this.props.hasMultipleParticipants;
+
+        // The participants can only be modified when:
+        // 1. The action is initiated from directly within a group chat and not the floating-action-button (eg. this.props.isIOUAttachedToExistingChatReport === true)
+        // 2. There are multiple participants (eg. this.props.hasMultipleParticipants === true)
+        const canModifyParticipants = this.props.isIOUAttachedToExistingChatReport && this.props.hasMultipleParticipants;
 
         return (
             <OptionsSelector

From 7195b08f208323f51f339d517e2b4b5305747db6 Mon Sep 17 00:00:00 2001
From: Tim Golen <tgolen@expensify.com>
Date: Fri, 2 Dec 2022 10:49:36 -0700
Subject: [PATCH 2/4] Correct the logic for when bill split particpants can be
 selected

---
 src/components/IOUConfirmationList.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/components/IOUConfirmationList.js b/src/components/IOUConfirmationList.js
index 4f4eb415ed4b..06e8b132c943 100755
--- a/src/components/IOUConfirmationList.js
+++ b/src/components/IOUConfirmationList.js
@@ -275,7 +275,13 @@ class IOUConfirmationList extends Component {
         const shouldShowSettlementButton = this.props.iouType === CONST.IOU.IOU_TYPE.SEND;
         const shouldDisableButton = selectedParticipants.length === 0;
         const recipient = this.state.participants[0];
-        const canModifyParticipants = !this.props.isIOUAttachedToExistingChatReport && this.props.hasMultipleParticipants;
+
+        // The participants can only be modified when:
+        // 1. The action is initiated from directly within a group chat and not the floating-action-button (eg. this.props.isIOUAttachedToExistingChatReport === true). This is because when
+        // there is a group of people, say they are on a trip, and you have some shared expenses with some of the people, but not all of them (maybe someone skipped out on dinner). Then
+        // it's nice to be able to select/deselect people from the group chat bill split rather than forcing the user to create a new group, just for that expense.
+        // 2. There are multiple participants (eg. this.props.hasMultipleParticipants === true). This is because splitting a bill with one person isn't a thing :D
+        const canModifyParticipants = this.props.isIOUAttachedToExistingChatReport && this.props.hasMultipleParticipants;
 
         return (
             <OptionsSelector

From 104965c8f4602312ab037ae3eda92d212b57d187 Mon Sep 17 00:00:00 2001
From: Tim Golen <tgolen@expensify.com>
Date: Fri, 2 Dec 2022 10:54:17 -0700
Subject: [PATCH 3/4] Add more context to the comment in props

---
 src/components/IOUConfirmationList.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/components/IOUConfirmationList.js b/src/components/IOUConfirmationList.js
index 06e8b132c943..67bb596f3449 100755
--- a/src/components/IOUConfirmationList.js
+++ b/src/components/IOUConfirmationList.js
@@ -57,7 +57,8 @@ const propTypes = {
         phoneNumber: PropTypes.string,
     })).isRequired,
 
-    /** Is this IOU associated with existing report */
+    /** Is this IOU associated with existing report. This is true when the action is initiated from inside a group chat and it's false when the action is initiated from the
+     * floating-action-button */
     isIOUAttachedToExistingChatReport: PropTypes.bool.isRequired,
 
     ...windowDimensionsPropTypes,

From 18ae34f5b833f8561bed2bcf9f002eba4d6dafe5 Mon Sep 17 00:00:00 2001
From: Tim Golen <tgolen@expensify.com>
Date: Mon, 5 Dec 2022 07:57:55 -0700
Subject: [PATCH 4/4] Move comment and rename prop

---
 src/components/IOUConfirmationList.js | 14 ++++----------
 src/pages/iou/IOUModal.js             |  8 +++++++-
 src/pages/iou/steps/IOUConfirmPage.js |  7 ++++---
 3 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/src/components/IOUConfirmationList.js b/src/components/IOUConfirmationList.js
index 67bb596f3449..7e2de32e502d 100755
--- a/src/components/IOUConfirmationList.js
+++ b/src/components/IOUConfirmationList.js
@@ -57,9 +57,8 @@ const propTypes = {
         phoneNumber: PropTypes.string,
     })).isRequired,
 
-    /** Is this IOU associated with existing report. This is true when the action is initiated from inside a group chat and it's false when the action is initiated from the
-     * floating-action-button */
-    isIOUAttachedToExistingChatReport: PropTypes.bool.isRequired,
+    /** Can the participants be modified or not */
+    canModifyParticipants: PropTypes.bool,
 
     ...windowDimensionsPropTypes,
 
@@ -92,6 +91,7 @@ const defaultProps = {
     onUpdateComment: null,
     comment: '',
     iouType: CONST.IOU.IOU_TYPE.REQUEST,
+    canModifyParticipants: false,
     ...withCurrentUserPersonalDetailsDefaultProps,
 };
 
@@ -276,13 +276,7 @@ class IOUConfirmationList extends Component {
         const shouldShowSettlementButton = this.props.iouType === CONST.IOU.IOU_TYPE.SEND;
         const shouldDisableButton = selectedParticipants.length === 0;
         const recipient = this.state.participants[0];
-
-        // The participants can only be modified when:
-        // 1. The action is initiated from directly within a group chat and not the floating-action-button (eg. this.props.isIOUAttachedToExistingChatReport === true). This is because when
-        // there is a group of people, say they are on a trip, and you have some shared expenses with some of the people, but not all of them (maybe someone skipped out on dinner). Then
-        // it's nice to be able to select/deselect people from the group chat bill split rather than forcing the user to create a new group, just for that expense.
-        // 2. There are multiple participants (eg. this.props.hasMultipleParticipants === true). This is because splitting a bill with one person isn't a thing :D
-        const canModifyParticipants = this.props.isIOUAttachedToExistingChatReport && this.props.hasMultipleParticipants;
+        const canModifyParticipants = this.props.canModifyParticipants && this.props.hasMultipleParticipants;
 
         return (
             <OptionsSelector
diff --git a/src/pages/iou/IOUModal.js b/src/pages/iou/IOUModal.js
index 67b5ab23f2a7..34033ea98f8a 100755
--- a/src/pages/iou/IOUModal.js
+++ b/src/pages/iou/IOUModal.js
@@ -450,7 +450,13 @@ class IOUModal extends Component {
                                                 comment={this.state.comment}
                                                 onUpdateComment={this.updateComment}
                                                 iouType={this.props.iouType}
-                                                isIOUAttachedToExistingChatReport={!_.isEmpty(reportID)}
+
+                                                // The participants can only be modified when the action is initiated from directly within a group chat and not the floating-action-button.
+                                                // This is because when there is a group of people, say they are on a trip, and you have some shared expenses with some of the people,
+                                                // but not all of them (maybe someone skipped out on dinner). Then it's nice to be able to select/deselect people from the group chat bill
+                                                // split rather than forcing the user to create a new group, just for that expense. The reportID is empty, when the action was initiated from
+                                                // the floating-action-button (since it is something that exists outside the context of a report).
+                                                canModifyParticipants={!_.isEmpty(reportID)}
                                             />
                                         </AnimatedStep>
                                     )}
diff --git a/src/pages/iou/steps/IOUConfirmPage.js b/src/pages/iou/steps/IOUConfirmPage.js
index c14626399f2c..7f69fc7ef9a1 100644
--- a/src/pages/iou/steps/IOUConfirmPage.js
+++ b/src/pages/iou/steps/IOUConfirmPage.js
@@ -43,14 +43,15 @@ const propTypes = {
     /** IOU type */
     iouType: PropTypes.string,
 
-    /** Is this IOU associated with existing report */
-    isIOUAttachedToExistingChatReport: PropTypes.bool.isRequired,
+    /** Can the participants be modified or not */
+    canModifyParticipants: PropTypes.bool,
 };
 
 const defaultProps = {
     onUpdateComment: null,
     comment: '',
     iouType: CONST.IOU.IOU_TYPE.REQUEST,
+    canModifyParticipants: false,
 };
 
 const IOUConfirmPage = props => (
@@ -63,7 +64,7 @@ const IOUConfirmPage = props => (
         onConfirm={props.onConfirm}
         onSendMoney={props.onSendMoney}
         iouType={props.iouType}
-        isIOUAttachedToExistingChatReport={props.isIOUAttachedToExistingChatReport}
+        canModifyParticipants={props.canModifyParticipants}
     />
 );
 
