@@ -211,24 +211,6 @@ function canEditReportAction(reportAction) {
211
211
) ;
212
212
}
213
213
214
- /**
215
- * Can only flag if:
216
- *
217
- * - It was written by someone else
218
- * - It's an ADDCOMMENT that is not an attachment
219
- *
220
- * @param {Object } reportAction
221
- * @returns {Boolean }
222
- */
223
- function canFlagReportAction ( reportAction ) {
224
- return (
225
- ! loginList . includes ( reportAction . actorEmail ) &&
226
- reportAction . actionName === CONST . REPORT . ACTIONS . TYPE . ADDCOMMENT &&
227
- ! ReportActionsUtils . isDeletedAction ( reportAction ) &&
228
- ! ReportActionsUtils . isCreatedTaskReportAction ( reportAction )
229
- ) ;
230
- }
231
-
232
214
/**
233
215
* Whether the Money Request report is settled
234
216
*
@@ -2123,6 +2105,26 @@ function chatIncludesChronos(report) {
2123
2105
return report . participantAccountIDs && _ . contains ( report . participantAccountIDs , CONST . ACCOUNT_ID . CHRONOS ) ;
2124
2106
}
2125
2107
2108
+ /**
2109
+ * Can only flag if:
2110
+ *
2111
+ * - It was written by someone else
2112
+ * - It's an ADDCOMMENT that is not an attachment
2113
+ *
2114
+ * @param {Object } reportAction
2115
+ * @param {number } reportID
2116
+ * @returns {Boolean }
2117
+ */
2118
+ function canFlagReportAction ( reportAction , reportID ) {
2119
+ return (
2120
+ ! loginList . includes ( reportAction . actorEmail ) &&
2121
+ reportAction . actionName === CONST . REPORT . ACTIONS . TYPE . ADDCOMMENT &&
2122
+ ! ReportActionsUtils . isDeletedAction ( reportAction ) &&
2123
+ ! ReportActionsUtils . isCreatedTaskReportAction ( reportAction ) &&
2124
+ isAllowedToComment ( getReport ( reportID ) )
2125
+ ) ;
2126
+ }
2127
+
2126
2128
/**
2127
2129
* Whether flag comment page should show
2128
2130
*
@@ -2133,7 +2135,7 @@ function chatIncludesChronos(report) {
2133
2135
2134
2136
function shouldShowFlagComment ( reportAction , report ) {
2135
2137
return (
2136
- canFlagReportAction ( reportAction ) &&
2138
+ canFlagReportAction ( reportAction , report . reportID ) &&
2137
2139
! isArchivedRoom ( report ) &&
2138
2140
! chatIncludesChronos ( report ) &&
2139
2141
! isConciergeChatReport ( report . reportID ) &&
0 commit comments