Skip to content

Commit

Permalink
Merge pull request online-go#2900 from GreenAsJade/fix_report_action_…
Browse files Browse the repository at this point in the history
…button_attachment

Fix attaching actions to reports in report list view
  • Loading branch information
anoek authored Dec 21, 2024
2 parents 904a198 + 171db54 commit bb20306
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/components/IncidentReportTracker/IncidentReportList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export function IncidentReportList({
data.set("ui-state.show_incident_list", false);
}

const attachActions = (report: Report) => {
// Most of these may no longer be needed, since we're using the new ReportsCenter view.
// Attach appropriate actions to each report
reports.forEach((report) => {
if (report.state !== "resolved") {
report.unclaim = () => {
post(`moderation/incident/${report.id}`, { id: report.id, action: "unclaim" })
Expand Down Expand Up @@ -112,11 +112,7 @@ export function IncidentReportList({
});
};
}
};

React.useEffect(() => {
reports.forEach(attachActions);
}, [reports]);
});

return (
<div className="IncidentReportList">
Expand Down

0 comments on commit bb20306

Please sign in to comment.