fix(dashboard): crashes when trial expired for some intervals

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-03-30 22:59:49 +02:00
parent a9c664dcfb
commit ec5207947b
2 changed files with 9 additions and 1 deletions

View File

@@ -50,6 +50,10 @@ function getCurrentAndPrevious<
);
if (endDate) {
current.endDate = endDate;
// Only expired trial scenarios
if (new Date(current.startDate) > new Date(current.endDate)) {
current.startDate = current.endDate;
}
}
const res = await Promise.all([
fn({