Skip to content

Commit c76a4c2

Browse files
committed
No longer load the previous pulse.
1 parent 6817a6f commit c76a4c2

File tree

1 file changed

+1
-34
lines changed

1 file changed

+1
-34
lines changed

web-ui/src/pages/PulsePage.jsx

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { format } from 'date-fns';
33
import React, { useContext, useEffect, useState } from 'react';
44
import { useHistory } from 'react-router-dom';
55
import { Button, Checkbox, Typography } from '@mui/material';
6-
import { downloadData, initiate } from '../api/generic.js';
6+
import { initiate } from '../api/generic.js';
77
import Pulse from '../components/pulse/Pulse.jsx';
88
import { AppContext } from '../context/AppContext';
99
import { selectCsrfToken, selectCurrentUser } from '../context/selectors';
@@ -54,39 +54,6 @@ const PulsePage = () => {
5454
center : pulse.externalScore - 1);
5555
}, [pulse]);
5656

57-
const loadTodayPulse = async () => {
58-
if (!csrf || !currentUser?.id) return;
59-
60-
const query = {
61-
dateFrom: today,
62-
dateTo: today,
63-
teamMemberId: currentUser.id
64-
};
65-
66-
const res = await downloadData(pulseURL, csrf, query);
67-
if (res.error) return;
68-
69-
// Sort pulse responses by date, latest to earliest
70-
const pulses = res.payload.data?.sort((a, b) => {
71-
const l = a.submissionDate;
72-
const r = b.submissionDate;
73-
if (r[0] == l[0]) {
74-
if (r[1] == l[1]) {
75-
return r[2] - l[2];
76-
} else {
77-
return r[1] - l[1];
78-
}
79-
} else {
80-
return r[0] - l[0];
81-
}
82-
});
83-
setPulse(pulses.at(0));
84-
};
85-
86-
useEffect(() => {
87-
loadTodayPulse();
88-
}, [csrf, currentUser]);
89-
9057
const submit = async () => {
9158
const myId = currentUser?.id;
9259
const data = {

0 commit comments

Comments
 (0)