mirror of
https://github.com/cpvalente/ontime.git
synced 2026-07-26 10:38:55 +00:00
chore(rundown): improve documentation of insert logic
This commit is contained in:
committed by
Carlos Valente
parent
5f040092cb
commit
8363f06a5c
@@ -60,6 +60,7 @@ export type EventOptions = Partial<{
|
||||
before: MaybeString;
|
||||
// options of entries of type OntimeEvent
|
||||
linkPrevious: boolean;
|
||||
/** the timing reference for the new entry, usually the same as after */
|
||||
lastEventId: MaybeString;
|
||||
}>;
|
||||
|
||||
@@ -205,8 +206,8 @@ function useEntryActionsForRundown(scopedRundownId: string | undefined) {
|
||||
|
||||
// ************* CHECK OPTIONS specific to events
|
||||
if (isOntimeEvent(newEntry)) {
|
||||
// last event id is the timing reference of the previous OntimeEvent in rundown
|
||||
if (options?.lastEventId) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- we know this is a value
|
||||
const previousEvent = rundownData.entries[options?.lastEventId];
|
||||
if (isOntimeEvent(previousEvent)) {
|
||||
newEntry.timeStart = previousEvent.timeEnd;
|
||||
|
||||
@@ -96,7 +96,7 @@ export function useRundownCommands({
|
||||
addEntry(patch, {
|
||||
after: id && !above ? id : undefined,
|
||||
before: id && above ? id : undefined,
|
||||
lastEventId: !above && id ? id : undefined,
|
||||
lastEventId: id && !above ? id : undefined,
|
||||
});
|
||||
},
|
||||
[addEntry],
|
||||
|
||||
Reference in New Issue
Block a user