Skip to content

Commit b9a531d

Browse files
authored
Merge pull request #24412 from hungvu193/fix-23377
Show reply in thread for IOU and Task.
2 parents 3538ba8 + e2ed67b commit b9a531d

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/libs/ReportActionsUtils.js

+9
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,14 @@ function isMessageDeleted(reportAction) {
580580
return lodashGet(reportAction, ['message', 0, 'isDeletedParentAction'], false);
581581
}
582582

583+
/**
584+
* @param {*} reportAction
585+
* @returns {Boolean}
586+
*/
587+
function isSplitBillAction(reportAction) {
588+
return lodashGet(reportAction, 'originalMessage.type', '') === CONST.IOU.REPORT_ACTION_TYPE.SPLIT;
589+
}
590+
583591
export {
584592
getSortedReportActions,
585593
getLastVisibleAction,
@@ -614,4 +622,5 @@ export {
614622
isWhisperAction,
615623
isPendingRemove,
616624
getReportAction,
625+
isSplitBillAction,
617626
};

src/pages/home/report/ContextMenu/ContextMenuActions.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,15 @@ export default [
119119
icon: Expensicons.ChatBubble,
120120
successTextTranslateKey: '',
121121
successIcon: null,
122-
shouldShow: (type, reportAction, isArchivedRoom, betas, anchor, isChronosReport, reportID) =>
123-
type === CONTEXT_MENU_TYPES.REPORT_ACTION && reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT && !ReportUtils.isThreadFirstChat(reportAction, reportID),
122+
shouldShow: (type, reportAction, isArchivedRoom, betas, anchor, isChronosReport, reportID) => {
123+
if (type !== CONTEXT_MENU_TYPES.REPORT_ACTION) {
124+
return false;
125+
}
126+
const isCommentAction = reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT && !ReportUtils.isThreadFirstChat(reportAction, reportID);
127+
const isReportPreviewAction = reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW;
128+
const isIOUAction = reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.IOU && !ReportActionUtils.isSplitBillAction(reportAction);
129+
return isCommentAction || isReportPreviewAction || isIOUAction;
130+
},
124131
onPress: (closePopover, {reportAction, reportID}) => {
125132
if (closePopover) {
126133
hideContextMenu(false, () => {

0 commit comments

Comments
 (0)