Skip to content

Commit d6c3cdd

Browse files
committed
Filter out invalid pulse data.
1 parent a11ffaf commit d6c3cdd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

web-ui/src/pages/PulseReportPage.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,13 @@ const PulseReportPage = () => {
328328
});
329329
if (res.error) return;
330330

331-
const pulses = res.payload.data;
331+
// Get the pulses and filter out invalid data.
332+
const pulses = res.payload.data.filter((pulse) => {
333+
return pulse.internalScore > 0 && pulse.internalScore <= 5 &&
334+
(pulse.externalScore == null ||
335+
(pulse.externalScore > 0 && pulse.externalScore <= 5));
336+
});
337+
332338
// Sort the pulses on their submission date.
333339
pulses.sort((p1, p2) => {
334340
const [year1, month1, day1] = p1.submissionDate;

0 commit comments

Comments
 (0)