Skip to content

Commit

Permalink
Merge pull request #25583 from namhihi237/fix-24445-undo-delete-message
Browse files Browse the repository at this point in the history
fix undo message after delete
  • Loading branch information
Gonals authored Oct 2, 2023
2 parents aaa8ae3 + 82e2bd9 commit c390d5e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ function ReportActionItem(props) {
Report.expandURLPreview(props.report.reportID, props.action.reportActionID);
}, [props.action, props.report.reportID]);

useEffect(() => {
if (!props.draftMessage || !ReportActionsUtils.isDeletedAction(props.action)) {
return;
}
Report.saveReportActionDraft(props.report.reportID, props.action, '');
}, [props.draftMessage, props.action, props.report.reportID]);

// Hide the message if it is being moderated for a higher offense, or is hidden by a moderator
// Removed messages should not be shown anyway and should not need this flow
const latestDecision = lodashGet(props, ['action', 'message', 0, 'moderationDecision', 'decision'], '');
Expand Down

0 comments on commit c390d5e

Please sign in to comment.