@@ -3787,7 +3787,7 @@ function buildOptimisticRenamedRoomReportAction(newName: string, oldName: string
3787
3787
* Returns the necessary reportAction onyx data to indicate that the transaction has been put on hold optimistically
3788
3788
* @param [created] - Action created time
3789
3789
*/
3790
- function buildOptimisticHoldReportAction ( comment : string , created = DateUtils . getDBTime ( ) ) : OptimisticHoldReportAction {
3790
+ function buildOptimisticHoldReportAction ( created = DateUtils . getDBTime ( ) ) : OptimisticHoldReportAction {
3791
3791
return {
3792
3792
reportActionID : NumberUtils . rand64 ( ) ,
3793
3793
actionName : CONST . REPORT . ACTIONS . TYPE . HOLD ,
@@ -3797,10 +3797,37 @@ function buildOptimisticHoldReportAction(comment: string, created = DateUtils.ge
3797
3797
{
3798
3798
type : CONST . REPORT . MESSAGE . TYPE . TEXT ,
3799
3799
style : 'normal' ,
3800
- text : Localize . translateLocal ( 'iou.heldRequest' , { comment } ) ,
3800
+ text : Localize . translateLocal ( 'iou.heldRequest' ) ,
3801
3801
} ,
3802
+ ] ,
3803
+ person : [
3802
3804
{
3803
- type : CONST . REPORT . MESSAGE . TYPE . COMMENT ,
3805
+ type : CONST . REPORT . MESSAGE . TYPE . TEXT ,
3806
+ style : 'strong' ,
3807
+ text : getCurrentUserDisplayNameOrEmail ( ) ,
3808
+ } ,
3809
+ ] ,
3810
+ automatic : false ,
3811
+ avatar : getCurrentUserAvatarOrDefault ( ) ,
3812
+ created,
3813
+ shouldShow : true ,
3814
+ } ;
3815
+ }
3816
+
3817
+ /**
3818
+ * Returns the necessary reportAction onyx data to indicate that the transaction has been put on hold optimistically
3819
+ * @param [created] - Action created time
3820
+ */
3821
+ function buildOptimisticHoldReportActionComment ( comment : string , created = DateUtils . getDBTime ( ) ) : OptimisticHoldReportAction {
3822
+ return {
3823
+ reportActionID : NumberUtils . rand64 ( ) ,
3824
+ actionName : CONST . REPORT . ACTIONS . TYPE . HOLDCOMMENT ,
3825
+ pendingAction : CONST . RED_BRICK_ROAD_PENDING_ACTION . ADD ,
3826
+ actorAccountID : currentUserAccountID ,
3827
+ message : [
3828
+ {
3829
+ type : CONST . REPORT . MESSAGE . TYPE . TEXT ,
3830
+ style : 'normal' ,
3804
3831
text : comment ,
3805
3832
} ,
3806
3833
] ,
@@ -5649,6 +5676,7 @@ export {
5649
5676
hasSmartscanError ,
5650
5677
shouldAutoFocusOnKeyPress ,
5651
5678
buildOptimisticHoldReportAction ,
5679
+ buildOptimisticHoldReportActionComment ,
5652
5680
buildOptimisticUnHoldReportAction ,
5653
5681
shouldDisplayThreadReplies ,
5654
5682
shouldDisableThread ,
0 commit comments