From 78f418f408bff5bb3a6a54dd62325bd522291709 Mon Sep 17 00:00:00 2001 From: Daniel Gale-Rosen Date: Mon, 3 Jul 2023 17:06:29 -0400 Subject: [PATCH 1/2] clean up conditionals --- src/pages/home/report/ReportActionItem.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 2afd28f934fe..d34862a93adf 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -151,12 +151,11 @@ function ReportActionItem(props) { const decisions = lodashGet(props, ['action', 'message', 0, 'moderationDecisions'], []); const latestDecision = lodashGet(_.last(decisions), 'decision', ''); useEffect(() => { - if (!props.action.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT || _.isEmpty(latestDecision)) { + if (props.action.actionName !== CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT || _.isEmpty(latestDecision)) { return; } - if (latestDecision === CONST.MODERATION.MODERATOR_DECISION_PENDING_HIDE || latestDecision === CONST.MODERATION.MODERATOR_DECISION_HIDDEN) { - setIsHidden(true); + if (_.contains([CONST.MODERATION.MODERATOR_DECISION_PENDING_HIDE, CONST.MODERATION.MODERATOR_DECISION_HIDDEN], latestDecision)) { setIsHidden(true); } setModerationDecision(latestDecision); }, [latestDecision, props.action.actionName]); From eb4e3220189ea12aa6dcbd13a536884bff126784 Mon Sep 17 00:00:00 2001 From: Daniel Gale-Rosen Date: Mon, 3 Jul 2023 17:27:03 -0400 Subject: [PATCH 2/2] prettier --- src/pages/home/report/ReportActionItem.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index d34862a93adf..72d411fb9d2b 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -155,7 +155,8 @@ function ReportActionItem(props) { return; } - if (_.contains([CONST.MODERATION.MODERATOR_DECISION_PENDING_HIDE, CONST.MODERATION.MODERATOR_DECISION_HIDDEN], latestDecision)) { setIsHidden(true); + if (_.contains([CONST.MODERATION.MODERATOR_DECISION_PENDING_HIDE, CONST.MODERATION.MODERATOR_DECISION_HIDDEN], latestDecision)) { + setIsHidden(true); } setModerationDecision(latestDecision); }, [latestDecision, props.action.actionName]);