From 5059985df6b6061b8317e761ae7cd2da7522e326 Mon Sep 17 00:00:00 2001 From: FitseTLT Date: Fri, 23 Aug 2024 23:45:05 +0300 Subject: [PATCH] fix room mention in edit message --- src/pages/home/report/ReportActionItem.tsx | 1 + src/pages/home/report/ReportActionItemMessageEdit.tsx | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index e4dab8518eb2..bc875ccda703 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -722,6 +722,7 @@ function ReportActionItem({ action={action} draftMessage={draftMessage} reportID={report.reportID} + policyID={report.policyID} index={index} ref={textInputRef} shouldDisableEmojiPicker={ diff --git a/src/pages/home/report/ReportActionItemMessageEdit.tsx b/src/pages/home/report/ReportActionItemMessageEdit.tsx index 15b901689ddc..73bea7060b36 100644 --- a/src/pages/home/report/ReportActionItemMessageEdit.tsx +++ b/src/pages/home/report/ReportActionItemMessageEdit.tsx @@ -61,6 +61,9 @@ type ReportActionItemMessageEditProps = { /** ReportID that holds the comment we're editing */ reportID: string; + /** PolicyID of the policy the report belongs to */ + policyID?: string; + /** Position index of the report action in the overall report FlatList view */ index: number; @@ -68,7 +71,7 @@ type ReportActionItemMessageEditProps = { shouldDisableEmojiPicker?: boolean; /** Whether report is from group policy */ - isGroupPolicyReport?: boolean; + isGroupPolicyReport: boolean; }; // native ids @@ -81,7 +84,7 @@ const shouldUseForcedSelectionRange = shouldUseEmojiPickerSelection(); const draftMessageVideoAttributeCache = new Map(); function ReportActionItemMessageEdit( - {action, draftMessage, reportID, index, isGroupPolicyReport, shouldDisableEmojiPicker = false}: ReportActionItemMessageEditProps, + {action, draftMessage, reportID, policyID, index, isGroupPolicyReport, shouldDisableEmojiPicker = false}: ReportActionItemMessageEditProps, forwardedRef: ForwardedRef, ) { const [preferredSkinTone] = useOnyx(ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE, {initialValue: CONST.EMOJI_DEFAULT_SKIN_TONE}); @@ -532,7 +535,8 @@ function ReportActionItemMessageEdit( isComposerFocused={textInputRef.current?.isFocused()} updateComment={updateDraft} measureParentContainerAndReportCursor={measureParentContainerAndReportCursor} - isGroupPolicyReport={false} + isGroupPolicyReport={isGroupPolicyReport} + policyID={policyID} value={draft} selection={selection} setSelection={setSelection}