Skip to content

Commit

Permalink
Revert "prettier"
Browse files Browse the repository at this point in the history
This reverts commit b99a8ad.

revert change
  • Loading branch information
Su Yeon Lee authored and Su Yeon Lee committed Jul 24, 2024
1 parent b99a8ad commit 186477c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions client/src/Reports/ReportsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,15 @@ function ReportsPage() {
setAlignment(newTimeInterval);
};

useEffect(() => {
updateTimeInterval();
}, [alignment, donations]);

const updateTimeInterval = () => {
if (donations) {
const filteredDonations = donations.filter((donation: any) => {
const donationDate = dayjs(donation.date);
const reportDate = dayjs();
const reportDate = dayjs(); //today
if (alignment === 'last_all') {
setStartTimePeriod(dayjs('1999-09-09'));
}
Expand Down Expand Up @@ -417,14 +421,10 @@ function ReportsPage() {
}
}


useEffect(() => {
updateTimeInterval();
}, [alignment, donations, updateTimeInterval]);

const generateReport = () => {
setErrorMessage(false);
const loadReport = getReportForDateRange(
let loadReport;
loadReport = getReportForDateRange(
timefilteredDonations,
);

Expand Down Expand Up @@ -455,13 +455,13 @@ function ReportsPage() {
setErrorMessage(true);
}
}
}, [startTimePeriod, endTimePeriod, donations]);
}, [startTimePeriod, endTimePeriod]);

React.useEffect(() => {
if (timefilteredDonations) {
generateReport();
}
}, [timefilteredDonations, generateReport]);
}, [timefilteredDonations]);

const [purposeData, setPurposeData] = React.useState<any[]>([
{
Expand Down

0 comments on commit 186477c

Please sign in to comment.