Incrase timing for grouping timline items

This commit is contained in:
Nick Mowen 2024-01-17 07:31:45 -07:00
parent 066fdc469c
commit b7231ca0a0

View File

@ -1,5 +1,5 @@
// group history cards by 60 seconds of activity // group history cards by 120 seconds of activity
const GROUP_SECONDS = 60; const GROUP_SECONDS = 120;
export function getHourlyTimelineData( export function getHourlyTimelineData(
timelinePages: HourlyTimeline[], timelinePages: HourlyTimeline[],
@ -59,20 +59,32 @@ export function getHourlyTimelineData(
// full: return all items // full: return all items
let add = true; let add = true;
const sourceType = sourceToTypes[sourceKey];
let hiddenItems: string[] = [];
if (detailLevel == "normal") { if (detailLevel == "normal") {
if ( hiddenItems = [
sourceToTypes[sourceKey].length > 1 && "active",
["active", "attribute", "gone", "stationary", "visible"].includes( "attribute",
i.class_type "gone",
) "stationary",
) { "visible",
add = false; ];
}
} else if (detailLevel == "extra") { } else if (detailLevel == "extra") {
hiddenItems = ["attribute", "gone", "visible"];
}
if (sourceType.length > 1) {
// we have multiple timeline items for this card
if ( if (
sourceToTypes[sourceKey].length > 1 && sourceType.find((type) => hiddenItems.includes(type) == false) ==
["attribute", "gone", "visible"].includes(i.class_type) undefined
) { ) {
// all of the attribute items for this card make it hidden, but we need to show one
if (sourceType.indexOf(i.class_type) != 0) {
add = false;
}
} else if (hiddenItems.includes(i.class_type)) {
add = false; add = false;
} }
} }