From 4fe63232cda8c6dbb798fcf499dd7af208d0660d Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Wed, 5 Jul 2023 22:39:04 +0700 Subject: [PATCH 1/4] cut off reveal button when deleting in offline mode --- src/pages/home/report/ReportActionItem.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 2afd28f934fe..85f01e0507e7 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -151,7 +151,13 @@ 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) { + return; + } + + if (_.isEmpty(latestDecision)) { + setModerationDecision(CONST.MODERATION.MODERATOR_DECISION_APPROVED); + setIsHidden(false); return; } From d5751ce8e9adcf38c59219999f1583161eae21b1 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Mon, 10 Jul 2023 12:33:23 +0700 Subject: [PATCH 2/4] add comment --- src/pages/home/report/ReportActionItem.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 51c500beacca..f14182f0f796 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -155,6 +155,7 @@ function ReportActionItem(props) { return; } + // Reset moderationDecision state to hide reveal button if latestDecision is changed to empty if (_.isEmpty(latestDecision)) { setModerationDecision(CONST.MODERATION.MODERATOR_DECISION_APPROVED); setIsHidden(false); From 7feca4fb0a9d2bbdcfef3c31d3a61707f655c600 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Mon, 10 Jul 2023 12:35:59 +0700 Subject: [PATCH 3/4] edit comment --- src/pages/home/report/ReportActionItem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index f14182f0f796..8e6f2017679a 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -155,7 +155,7 @@ function ReportActionItem(props) { return; } - // Reset moderationDecision state to hide reveal button if latestDecision is changed to empty + // Hide reveal message button and show the message if latestDecision is changed to empty if (_.isEmpty(latestDecision)) { setModerationDecision(CONST.MODERATION.MODERATOR_DECISION_APPROVED); setIsHidden(false); From 64107486849c0459f11cf7dea010d30bcc55cc1f Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Mon, 10 Jul 2023 12:42:49 +0700 Subject: [PATCH 4/4] fix lint --- src/pages/home/report/ReportActionItem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 8e6f2017679a..cc46502c258a 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -155,7 +155,7 @@ function ReportActionItem(props) { return; } - // Hide reveal message button and show the message if latestDecision is changed to empty + // Hide reveal message button and show the message if latestDecision is changed to empty if (_.isEmpty(latestDecision)) { setModerationDecision(CONST.MODERATION.MODERATOR_DECISION_APPROVED); setIsHidden(false);