Skip to content

Commit

Permalink
Merge pull request #37399 from dukenv0307/fix/36045-flag-as-offensive…
Browse files Browse the repository at this point in the history
…-is-absent

fix/36045: Flag as offensive is absent
  • Loading branch information
youssef-lr authored Mar 7, 2024
2 parents 634b543 + 0a4ced1 commit 15cf6ad
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4138,7 +4138,13 @@ function chatIncludesChronos(report: OnyxEntry<Report> | EmptyObject): boolean {
* - It's an ADDCOMMENT that is not an attachment
*/
function canFlagReportAction(reportAction: OnyxEntry<ReportAction>, reportID: string | undefined): boolean {
const report = getReport(reportID);
let report = getReport(reportID);

// If the childReportID exists in reportAction and is equal to the reportID,
// the report action being evaluated is the parent report action in a thread, and we should get the parent report to evaluate instead.
if (reportAction?.childReportID?.toString() === reportID?.toString()) {
report = getReport(report?.parentReportID);
}
const isCurrentUserAction = reportAction?.actorAccountID === currentUserAccountID;
const isOriginalMessageHaveHtml =
reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT ||
Expand Down

0 comments on commit 15cf6ad

Please sign in to comment.