Skip to content

Commit

Permalink
Temporary fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJem committed Sep 5, 2023
1 parent 6b34037 commit e245bae
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/views/Lending/Cooler/dashboard/DataHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ export const useCoolerSnapshots = (earliestDate: Date) => {
collateralIncome: 0,
};

console.log("created snapshot for date " + dateString);

// Add the snapshot to the map
tempSnapshots.set(dateString, coolerSnapshot);
});
Expand All @@ -109,7 +107,6 @@ export const useCoolerSnapshots = (earliestDate: Date) => {
// If there is an existing snapshot, track it and move on
if (coolerSnapshot) {
lastSnapshot = coolerSnapshot;
console.log("existing snapshot for date " + dateString);
currentDate.setDate(currentDate.getDate() + 1);
continue;
}
Expand All @@ -123,8 +120,6 @@ export const useCoolerSnapshots = (earliestDate: Date) => {
interestIncome: 0,
collateralIncome: 0,
};
console.log("created forward-fill snapshot for date " + dateString);
console.log("receivables = " + newSnapshot.receivables);

tempSnapshots.set(dateString, newSnapshot);

Expand All @@ -147,8 +142,9 @@ export const useCoolerSnapshots = (earliestDate: Date) => {
});

// Order snapshots to be in reverse-chronological order
setByDateSnapshot(Array.from(tempSnapshots.values()).sort((a, b) => b.timestamp - a.timestamp));
const tempByDateSnapshots = Array.from(tempSnapshots.values()).sort((a, b) => b.timestamp - a.timestamp);
// setByDateSnapshot(tempByDateSnapshots);

// Return the CoolerSnapshot
return byDateSnapshot;
return tempByDateSnapshots;
};

0 comments on commit e245bae

Please sign in to comment.