Skip to content

Commit

Permalink
Tweak to fetching latest snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJem committed Oct 15, 2024
1 parent 89c45bf commit 56a2184
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/views/Lending/Cooler/hooks/useSnapshot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ export const useCoolerSnapshot = (startDate?: Date, beforeDate?: Date) => {
};

export const useCoolerSnapshotLatest = () => {
// Go back 2 days
// Go back 1 day
// In case there is no snapshot (yet) for today, use yesterday's snapshot
const startDate = new Date();
startDate.setDate(startDate.getDate() - 2);
startDate.setDate(startDate.getDate() - 1);

const { data, isLoading } = useCoolerSnapshot(startDate);

Expand Down

0 comments on commit 56a2184

Please sign in to comment.