Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Su Yeon Lee authored and Su Yeon Lee committed Jul 24, 2024
1 parent a2bbb03 commit b99a8ad
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,15 +374,11 @@ 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(); //today
const reportDate = dayjs();
if (alignment === 'last_all') {
setStartTimePeriod(dayjs('1999-09-09'));
}
Expand Down Expand Up @@ -421,10 +417,14 @@ function ReportsPage() {
}
}


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

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

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

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

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

0 comments on commit b99a8ad

Please sign in to comment.