feat: operator view

This commit is contained in:
cv
2023-08-28 21:42:27 +02:00
parent 9886e986d3
commit 32f18d8d23
32 changed files with 399 additions and 316 deletions
@@ -26,6 +26,21 @@ export function getFirstEvent(rundown: OntimeRundownEntry[]) {
return null;
}
export function getLastEvent(rundown: OntimeRundown): OntimeEvent | null {
if (rundown.length < 1) {
return null;
}
for (let i = rundown.length - 1; i > 0; i--) {
const event = rundown.at(i);
if (isOntimeEvent(event)) {
return event;
}
}
return null;
}
/**
* Gets next event in rundown, if it exists
* @param {OntimeRundownEntry[]} rundown