@@ -131,6 +131,7 @@ function ReportActionItem(props) {
131
131
132
132
// Hide the message if it is being moderated for a higher offense, or is hidden by a moderator
133
133
// Removed messages should not be shown anyway and should not need this flow
134
+
134
135
useEffect ( ( ) => {
135
136
if ( ! props . action . actionName === CONST . REPORT . ACTIONS . TYPE . ADDCOMMENT || _ . isEmpty ( props . action . message [ 0 ] . moderationDecisions ) ) {
136
137
return ;
@@ -146,7 +147,10 @@ function ReportActionItem(props) {
146
147
setIsHidden ( true ) ;
147
148
}
148
149
setModerationDecision ( latestDecision . decision ) ;
149
- } , [ props . action . message , props . action . actionName ] ) ;
150
+
151
+ // props.action.message doesn't need to be a dependency, we only need to check the change of props.action.message[0].moderationDecisions
152
+ // eslint-disable-next-line react-hooks/exhaustive-deps
153
+ } , [ props . action . message [ 0 ] . moderationDecisions , props . action . actionName ] ) ;
150
154
151
155
const toggleContextMenuFromActiveReportAction = useCallback ( ( ) => {
152
156
setIsContextMenuActive ( ReportActionContextMenu . isActiveReportAction ( props . action . reportActionID ) ) ;
@@ -279,7 +283,7 @@ function ReportActionItem(props) {
279
283
: undefined ,
280
284
] }
281
285
/>
282
- { props . displayAsGroup && hasBeenFlagged && (
286
+ { hasBeenFlagged && (
283
287
< Button
284
288
small
285
289
style = { [ styles . mt2 , styles . alignSelfStart ] }
@@ -309,20 +313,6 @@ function ReportActionItem(props) {
309
313
}
310
314
/>
311
315
) }
312
- { ! props . displayAsGroup && hasBeenFlagged && (
313
- < Button
314
- small
315
- style = { [ styles . mt2 , styles . alignSelfStart ] }
316
- onPress = { ( ) => setIsHidden ( ! isHidden ) }
317
- >
318
- < Text
319
- style = { styles . buttonSmallText }
320
- selectable = { false }
321
- >
322
- { isHidden ? props . translate ( 'moderation.revealMessage' ) : props . translate ( 'moderation.hideMessage' ) }
323
- </ Text >
324
- </ Button >
325
- ) }
326
316
</ ShowContextMenuContext . Provider >
327
317
) ;
328
318
}
0 commit comments